标签:
4
1 1
2 3
0 5
3 7
2560
#include <iostream> using namespace std; int main() { int N,A,B,a[107]; int m=0,i; cin>>N; for(i=0;i<N;i++) { cin>>A>>B; a[i]=A+B; } for(i=N-1;i>=0;i--) { if(a[i]>=10&&i!=0) { m=a[i]%10; a[i]=m; a[i-1]+=1; } } for(i=0;i<N;i++) cout<<a[i]; return 0; }
标签:
原文地址:http://www.cnblogs.com/AquamarineOnly/p/5674687.html