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 |
Re:为什么测试了各种数据都是对的,但是提交的时候却还是Wrong呢???求大神帮助呀In Reply To:为什么测试了各种数据都是对的,但是提交的时候却还是Wrong呢???求大神帮助呀 Posted by:zhjacm at 2013-04-09 23:22:04 > #include<iostream> > using namespace std; > int main() > { > char temp[100]; > int sum[100]={0},i,s,j,k=0,t=0; > while(cin>>temp,temp[0]!='0') > { > int m[100]={0}; > for(i=0;temp[i]!='\0';i++); > if(i>k) > k=i; > for(j=100-i,s=0;j<100;s++,j++) > m[j]=temp[s]-48; > for(j=99;j>99-k;j--) > { > sum[j]+=m[j]; > if(j==100-k) > break; > if(sum[j]>=10) > { > sum[j]-=10; > sum[j-1]+=1; > } > } > for(i=0;i<100;i++) > temp[i]='\0';t++; > } > > for(i=100-k;i<100;i++) > cout<<sum[i]; > cout<<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