提交时间:2024-08-20 16:54:01

运行 ID: 169738

#include <bits/stdc++.h> using namespace std; int a[5005],b,c; int main() { int n; cin>>n; for(int i=n; i>=1; i--) { cin>>c>>b; a[i]+=b; a[i]+=c; a[i+1]+=a[i]/10; a[i]%=10; } if(a[n+1]!=0) { n++; } for(int i=n; i>=1; i--) { cout<<a[i]; } return 0; }