Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main()
- {
- const unsigned nMax=999;
- unsigned int n, sum, div;
- for (n=1;n<=nMax;n++){
- sum=0 ;
- for (div=1;div<n;div++){
- if(n%div==0)
- sum+=div;
- }
- if (sum==n)
- printf("%u\n",n);
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment