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 Alpha at 2004-05-14 22:02:38 on Problem 1331
In Reply To:实在不知道哪里出问题了 Posted by:faononl at 2004-05-14 20:03:21
> 		for( p = 2 ; p <= 16 && ok == 0 ; p++ ) 
                       ~~~~~~~~
                          p = max + 1
> 		{
> 			memset( temp , 0 , sizeof(temp));
> 			for( i = 0 ; i < lena ; i++ )
> 			{
> 				con = 0 ;
> 				for( j = 0 ; j < lenb ; j++ )
> 				{
> 					temp[i+j] += (a[i]-'0')*(b[j]-'0') ;
> 					con = temp[i+j] / p ;
> 					temp[i+j] %= p ;
> 				}
> 				temp[i+j] = con ;
> 			}
> 			ok = 1 ;
> 			for( i = 0 ; i < lenc ; i++ )
> 			{
> 				if ( c[lenc-i-1]-'0' != temp[i] )
> 				{
> 					ok = 0 ;
> 					break ;
> 				}
> 			}
> 		}
> 		p-- ;
> 		if ( p >= 16 ) p = 0 ;
> 		cout << p << endl ;
> 	} 
> }	

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