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> void main() { long n,i,j,s; printf("PERFECTION OUTPUT\n"); while(scanf("%ld",&n)){ if(n==0) {printf("END OF OUTPUT\n");break;} if(n==1) printf("%5d PERFECT\n",n); s=1; for(i=2;i<n;i++) if(n%i==0) s=s+i; if(s<n) printf("%5d DEFICIENT\n",n); if(s==n) printf("%5d PERFECT\n",n); if(s>n) printf("%5d ABUNDANT\n",n); } } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator