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 |
Re:要注意1是DEFICIENTIn Reply To:要注意1是DEFICIENT Posted by:382784268 at 2009-02-17 09:50:43 #include<iostream> #include<iomanip> using namespace std; int main() { int p[101]; int i,j; for(i=0;i<101;i++) { cin>>p[i]; if(p[i]==0) break; } cout<<"PERFECTION OUTPUT"<<endl; j=0; while(j<i) { int s=0; for(int k=1;k<=p[j]/2;k++) if(p[j]%k==0) s+=k; if(s>p[j]) cout<<setw(5)<<p[j]<<" ABUNDANT"<<endl; if(s==p[j]) cout<<setw(5)<<p[j]<<" PERFECT"<<endl; if(s<p[j]) cout<<setw(5)<<p[j]<<" DEFICIENT"<<endl; j++; } 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