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

这个进位的时候从前往后扫和从后往前扫不是一样的吗?为啥从前往后就是WA????????????????

Posted by 4053040 at 2011-08-07 22:31:37 on Problem 2602 and last updated at 2011-08-07 22:50:58
for(i=n-1;i>=0;i--)
	    if(a[i]> '9' && i)
		{
		a[i]-=10;
		a[i-1] += 1;
		}
		a[n] = '\0';




for(i = 0; i < n; i ++)
	    if(a[i]> '9' && i)
		{
		a[i]-=10;
		a[i-1] += 1;
		}
		a[n] = '\0';

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