| ||||||||||
| 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 <iostream>
using namespace std;
char a[1000001],b[1000001];
int n,i,q;
int main()
{
n=getchar();
getchar();
for(i=0;i<n;i++)
{
a[i]=getchar();
getchar();
b[i]=getchar();
getchar();
}
for(i=n-1;i>-1;i--)
{
a[i]+=b[i]+q-48;
if(a[i]>57){a[i]-=10;q=1;}
else q=0;
}
cout<<a<<endl;
return 0;
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator