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 jiangpeng at 2007-10-19 17:15:21 on Problem 1528
#include<iostream>
#include<ciomanip.h>
using namespace std;
int main()
{
    cout<<"PERFECTION OUTPUT"<<endl;
    int N;
    cin>>N;
    while(N)
    {
      int sum=1;
     for(int i=2;i<=N/2;i++)
      {
        if(N%i==0) sum+=i;
        }
      if(N>sum)          cout<<setw(5)<<N<<"  "<<"DEFICIENT"<<endl;
      else if(N==sum)    cout<<setw(5)<<N<<"  "<<"PERFECT"<<endl;
      else               cout<<setw(5)<<N<<"  "<<"ABUNDANT"<<endl;
     cin>>N;
    }
    cout<<"END OF OUTPUT"<<endl;
    return 0;
}

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