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<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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator