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

菜鸟求救,请大牛指点迷津。

Posted by change at 2005-09-20 23:34:17 on Problem 2602
#include"stdio.h"
#define M 100000   //再开大10倍就不行了,所以达不到要求。我不知道有什么解法,请大牛们不吝赐教!
int main()
{
	int i,n,d1,d2,c,a[];	
	scanf("%d",&n);
	    for(i=n;i>=1;i--)
		{   
			scanf("%d%d",&d1,&d2);    
	    	c=d1+d2;			
			if(c>=10)
			{
		    	a[i]=c%10;
			    a[i+1]++;
			}
			else a[i]=c;
			
		}		

		for(i=n;i>=1;i--)
			printf("%d",a[i]);
		printf("\n");
	
	return 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