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 |
为什么同样的代码一次 rantime error 一次ac了呢?#include<iostream.h> char a[1000001][3],b[1000001]; int main() { long int n,i,j,sum=0; cin>>n; for (i=0;i<n;i++) { for (j=0;j<2;j++) cin>>a[i][j]; } for (i=n-1;i>=0;i--) { sum=a[i][0]-'0'+a[i][1]-'0'; if(sum<10) b[i]=sum+'0'; else { b[i]=(sum)%10+'0'; a[i-1][0]+=1; } } for (i=0;i<n;i++) cout<<b[i]; return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator