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 |
颇为蹊跷,诸位请看(系统提示:Run-time error)#include<iostream.h> #include<string.h> #include<stdlib.h> char num[200]; void main() { cin>>num; while(strcmp(num,"0")!=0) { int sum=0; FIND: for(int i=0;num[i]!='\0';i++) sum+=(int(num[i])-int('0')); if(sum<10) cout<<sum<<endl; if(sum>=10) { for(int j=0;j<200;j++) num[j]=0; itoa(sum,num,10); sum=0; goto FIND; } for(int j=0;j<200;j++) num[j]=0; cin>>num; } } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator