https://acs.jxnu.edu.cn/problem/HDU1323
描述:
From the article Number Theory in the 1994 Microsoft Encarta: "If a, b, c are integers such that a = bc, a is called a multiple of b or of c, and b or c is called a divisor or factor of a. If c is not 1/-1, b is called a proper divisor of a. Even integers, which include 0, are multiples of 2, for example, -4, 0, 2, 10; an odd integer is an integer that is not even, for example, -5, 1, 3, 9. A perfect number is a positive integer that is equal to the sum of all its positive, proper divisors; for example, 6, which equals 1 + 2 + 3, and 28, which equals 1 + 2 + 4 + 7 + 14, are perfect numbers. A positive number that is not perfect is imperfect and is deficient or abundant according to whether the sum of its positive, proper divisors is smaller or larger than the number itself. Thus, 9, with proper divisors 1, 3, is deficient; 12, with proper divisors 1, 2, 3, 4, 6, is abundant."
Given a number, determine if it is perfect, abundant, or deficient.
输入:
A list of N positive integers (none greater than 60,000), with 1 < N < 100. A 0 will mark the end of the list.
输出:
The first line of output should read PERFECTION OUTPUT. The next N lines of output should list for each input integer whether it is perfect, deficient, or abundant, as shown in the example below. Format counts: the echoed integers should be right justified within the first 5 spaces of the output line, followed by two blank spaces, followed by the description of the integer. The final line of output should read END OF OUTPUT.
从1994年微软章程的数论:“如果a b c是整数且a=bc称,a为b或c的倍数,b或c称为a的除数或因子。”如果c不是1或-1,b被称为a的适当除数。包括0的偶数整数是2的倍数,例如,-4、0、2、10;奇数整数是一个不是偶数的整数,例如,-5、1、3、9。一个完美数是一个等于所有正因子的和的正整数;例如,6,等于1+2+3,28,等于1+2+4+7+14,是完美数。不完美的正数是不完美的,根据它的正的因子的和比数本身是不足的还是充足的。因此,9与适当的因子,3是不足的;12,有适当的因子1,2,3,4,6,是丰富的。”给定一个数字,确定它是完美的、充足的还是不足的。
输入:
N个正整数的列表(不大于60,000),包含1<N<100。A0将表示该列表的结束。
输出:
输出的第一行应该读取完美的输出。接下来的N行输出应该列出每个输入整数,无论它是完美的、有缺陷的还是充足的,如下面的示例所示。为了计数:重复的整数应该在输出线的前5个空格内正确地证明,然后是两个空格,然后是对整数的描述。输出的最后一行应该读取输出的结尾。