Posted on 2008-06-03 14:28
superman 阅读(313)
评论(0) 编辑 收藏 引用 所属分类:
ZOJ
1 /* Accepted 1284 C++ 00:00.01 836K */
2 #include <iostream>
3
4 using namespace std;
5
6 int main()
7 {
8 int n;
9 cout << "PERFECTION OUTPUT" << endl;
10 while(cin >> n && n)
11 {
12 int sum = 0;
13 for(int i = 1; i * 2 <= n; i++)
14 if(n % i == 0)
15 sum += i;
16 printf("%5d ", n);
17 if(sum == n)
18 cout << "PERFECT" << endl;
19 if(sum < n)
20 cout << "DEFICIENT" << endl;
21 if(sum > n)
22 cout << "ABUNDANT" << endl;
23 }
24 cout << "END OF OUTPUT" << endl;
25
26 return 0;
27 }
28