Nombre perfecte: diferència entre les revisions

Contingut suprimit Contingut afegit
Línia 28:
bool es_perfecte (int n) {
int sum=1;
for (int compt=2; compt*compt<=n ; ++compt) {
if (compt*compt==n) sum=sum+compt;
else if (n%compt==0) {