Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- int n, i, j, m, count;
- scanf("%d", &n);
- for (i = 1; i <= n; i++){
- scanf("%d", &m);
- count = 0;
- for (j = 1; j <= m; j++){
- if (m % j == 0) {
- count += j ;
- }
- }
- if(count == m)
- printf("%d eh perfeito\n",m);
- else
- printf("%d nao eh perfeito\n",m);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement