【十二题解】 | #完全数计算#
完全数计算
http://www.nowcoder.com/practice/7299c12e6abb437c87ad3e712383ff84
#include<stdio.h>
int main(){
int number;
while(scanf("%d", &number) != EOF){
int count = 0;
for(int i=1; i<=number; i++){
int all = 0;
for(int j=1; j<i; j++){
if(i%j==0)all+=j;
}
if(all == i)count++;
}
printf("%d\n", count);
}
}