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> long abc(long n) { long m,k,j; m=n%10; k=n-m; j=m; do { n=k/10; m=n%10; j=j+m; k=n-m; }while(k>0); return(j); } void main() { long n; scanf ("%d",&n); while(n!=0) { n=abc(n); while(n>=10) n=abc(n); printf("%d\n",n); scanf("%d",&n); } } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator