Advertisement
shohan11421

Untitled

Oct 10th, 2017
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.42 KB | None | 0 0
  1. #include <stdio.h>
  2. int main()
  3. {
  4.      int n, i, j, m, count;
  5.      scanf("%d", &n);
  6.      for (i = 1; i <= n; i++){
  7.         scanf("%d", &m);
  8.         count = 0;
  9.         for (j = 1; j <= m; j++){
  10.         if (m % j == 0) {
  11.             count += j ;
  12.         }
  13.         }
  14.         if(count == m)
  15.             printf("%d eh perfeito\n",m);
  16.         else
  17.             printf("%d nao eh perfeito\n",m);
  18.      }
  19.      return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement