Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

为什么总是WA?求大神指教。。。。。。。。。。。。

Posted by Code_King at 2013-07-21 17:43:20 on Problem 1528
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator