提交时间:2024-08-20 16:49:54
运行 ID: 169729
#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=1; i<=n; i++) { cout<<a[i]; } return 0; }