| ||||||||||
| 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 | |||||||||
菜鸟求救,请大牛指点迷津。#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator