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 |
这样都能WA?#include<stdio.h> #include<math.h> void main() { while(1) { int n; scanf("%d",&n); if(n==0) break; loop: int j=log10(n)+1,i,k=0; for(i=0;i<j;i++) { k+=n%10; n=n/10; } if(k<10) printf("%d\n",k); else { n=k; goto loop; } } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator