| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
Re:经典矩阵连乘问题,不知为什么答案错,帮忙看看In Reply To:经典矩阵连乘问题,不知为什么答案错,帮忙看看 Posted by:6233843 at 2006-10-12 23:25:25 >
>
> void Print_MCM(int i,int j)
> {
> if (i==j)
> {
> printf("A%d",i);
> }
> else
> {
> printf ("(");
> Print_MCM(1,path[i][j]);
> printf(" * ");
> Print_MCM(path[i][j]+1,j);
> printf(")");
> }
> }
=====>
> void TraceBack(int i,int j)
{
if (i==j)
{
printf("A%d",i);
}
else
{
printf ("(");
TraceBack(i,s[i][j]);
printf(" * ");
TraceBack(s[i][j]+1,j);
printf(")");
}
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator