标签:else eof more pac cat ott des ted ref
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 80782 Accepted Submission(s): 25278
#include <cstdio> #include <algorithm> #include <cstring> using namespace std; char a[20100]; int main() { int n,sum; while(scanf("%s",a)!=EOF) { if(strlen(a)==1&&a[0]==‘0‘)break; sum=0; for(int i=0;i<strlen(a);i++) sum+=a[i]-‘0‘; sum=sum%9; if(sum==0)puts("9"); else printf("%d\n",sum); } return 0; }
标签:else eof more pac cat ott des ted ref
原文地址:http://www.cnblogs.com/a249189046/p/7497515.html