Friday, February 1, 2019

URI 1164:: SOLUTION

URI Online Judge | 1164

Perfect Number

In mathematics, a perfect number is an integer for which the sum of all its own positive divisors (excluding itself) is equal to the number itself. For example the number 6 is perfect, because 1+2+3 is equal to 6. Your task is to write a program that read integer numbers and print a message informing if these numbers are perfect or are not perfect.

Input

The input contains several test cases. The first contains the number of test cases (1 ≤ N ≤ 100). Each one of the following N lines contains an integer X (1 ≤ X ≤ 108), that can be or not a perfect number.

Output

For each test case print the message “eh perfeito” (is perfect) or “nao eh perfeito” (X isn't perfect) according with to above specification.
Input SampleOutput Sample
3
6
5
28
6 eh perfeito
5 nao eh perfeito
28 eh perfeito



[WAIT]
     First of all, think yourself that you have tried enough for the problem. If you did not please read the program once. REMEMBER one thing, just believe in yourself.....YOU CAN.....YOU KNOW....


See the ANSWER here...
                                                                  

No comments:

Post a Comment