This commit is contained in:
2025-05-07 14:05:25 +03:00
parent 785c2b0e50
commit 50a27f1d6c
7 changed files with 128 additions and 0 deletions

View File

@ -0,0 +1,17 @@
#include <stdio.h>
int isPerfect(int);
int isPerfect(int num) {
int temp = 0;
for(int i = 1; i < num; i++) {
if(num % i == 0) {
temp += i;
}
}
if (temp == num) {
return 1;
} else {
return 0;
}
}