Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Re:经典矩阵连乘问题,不知为什么答案错,帮忙看看

Posted by dinglinbin at 2007-10-19 09:21:19
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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator