Description

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. 

Input

A list of N positive integers (none greater than 60,000), with 1 <= N < 100. A 0 will mark the end of the list.

Output

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.

Sample Input

15 28 6 56 60000 22 496 0

Sample Output

PERFECTION OUTPUT
15 DEFICIENT
28 PERFECT
6 PERFECT
56 ABUNDANT
60000 ABUNDANT
22 DEFICIENT
496 PERFECT
END OF OUTPUT

POJ 1528问题描述的更多相关文章

  1. poj 1528 Perfection

    题目链接:http://poj.org/problem?id=1528 题目大意:输入一个数n,然后求出约数的和sum,在与这一个数n进行比较,如果sum>n,则输出ABUNDANT,如果sum ...

  2. POJ 1041问题描述

    Description Little Johnny has got a new car. He decided to drive around the town to visit his friend ...

  3. POJ 1039问题描述

    Description The GX Light Pipeline Company started to prepare bent pipes for the new transgalactic li ...

  4. POJ 1035题目描述

    Description You, as a member of a development team for a new spell checking program, are to write a ...

  5. POJ 1032问题描述

    Description New convocation of The Fool Land's Parliament consists of N delegates. According to the ...

  6. POJ 1028题目描述

    Description Standard web browsers contain features to move backward and forward among the pages rece ...

  7. 九度OJ 1528 最长回文子串 -- Manacher算法

    题目地址:http://ac.jobdu.com/problem.php?pid=1528 题目描述: 回文串就是一个正读和反读都一样的字符串,比如"level"或者"n ...

  8. POJ 2718【permutation】

    POJ 2718 问题描述: 给一串数,求划分后一个子集以某种排列构成一个数,余下数以某种排列构成另一个数,求这两个数最小的差,注意0开头的处理. 超时问题:一开始是得到一个数列的组合之后再从中间进行 ...

  9. Electricity POJ - 2117 + SPF POJ - 1523 去除割点后求强连通分量个数问题

    Electricity POJ - 2117 题目描述 Blackouts and Dark Nights (also known as ACM++) is a company that provid ...

随机推荐

  1. 运用正则表达式在Asp中过滤Html标签代码的四种不同方法

    Function RemoveHTML(strHTML)Dim objregExp, Match, MatchesSet objRegExp = New RegexpobjRegExp.IgnoreC ...

  2. ACM对时间掌控力和日积月累的习惯的意义

    马云说,要想创业成功,不是要知道现在什么东西最火,而是要清楚的知道十年以后什么东西最火.这就意味着,你对时间掌控力,至少要有十年. 但是仔细回想一下自己的学生时代,自己对时间的把握是怎样的?有些人只能 ...

  3. SQLLite 可以通过SQL语言来访问的文件型SQL数据库

    Web Storage分为两类: - sessionStorage:数据保存在session 对象中(临时) - localStorage:数据保存在本地硬件设备中(永久) sessionStorag ...

  4. java 遍历文件夹里的文件

    Java遍历文件夹的2种方法: A.不使用递归: import java.io.File; import java.util.LinkedList; public class FileSystem { ...

  5. JavaScript系列:函数 自执行 表达式 声明 定义

    可用方式 (function($) {})(jQuery); !function( $ ){}(jQuery); +function( $ ){}(jQuery); -function( $ ){}( ...

  6. c/c++内存调试

    Leaktracer,Valgrind,ElectricFence 内存泄漏分类 以发生的方式来分类,内存泄漏可以分为4类: 常发性 发生内存泄漏的代码会被多次执行到,每次被执行的时候都会导致一块内存 ...

  7. ThinkPHP 3.2.2 视图模板中使用字符串截取函数

    在项目的 Common/function.php 文件里( 项目结构如图 ) 添加函数: /*字符串截断函数+省略号*/ function subtext($text, $length) { if(m ...

  8. python 执行文件时传参

    ## test.py ## ####################### import sys if __name__ == "__main__": args = sys.arg ...

  9. Yii源码阅读笔记(十)

    控制器类,所有控制器的基类,用于调用模型和布局,输出到视图 namespace yii\base; use Yii; /** * Controller is the base class for cl ...

  10. 神奇的 echo 命令

    #!/bin/bash 请输入密码,输入密码的时候不能看见因为颜色设置成跟背景色一样了,输入完密码进行加密,加密后保存在pass.txt echo "Please input a passw ...