| ||||||||||
| 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 | |||||||||
Accepted 1132K 1344MS C++ 298B#include <iostream>
char a[1000002]={0};
int main()
{
int n,i;
int x,y;
scanf("%d",&n);
a[n+1]='\0';
for(i=1;i<=n;i++)
{
scanf("%d%d",&x,&y);
a[i]=x+y+'0';
}
for(i=n;i>=1;i--)
{
a[i-1]+=(a[i]-'0')/10;
a[i]=(a[i]-'0')%10+'0';
}
printf("%s\n",a+1);
return 0;
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator