Advertisement
Guest User

bubata ty szmaciiiiiiiiirkoooooo

a guest
Mar 31st, 2020
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.36 KB | None | 0 0
  1. bool isPerfect2(long long int n)
  2.     {
  3.         int i = 1, sum = 0;
  4.  
  5.         while (i <= n)
  6.         {
  7.             if (i < n)
  8.             {
  9.                 if (n % i == 0)
  10.                     sum = sum + i;
  11.  
  12.             }
  13.             i++;
  14.         }
  15.         if (sum == n) {
  16.  
  17.             return true;
  18.  
  19.         }
  20.         return false;
  21.     }
  22. dominiczek debil
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement