#include <iostream>
using namespace std;
/*求解完数,数字的因数等于该数字,2-20000*/
int main()
{
int num = 0;
for(int i =2;i<=20000;i++){
int x = i,sum=0;
for(int j=1;j<x;j++){
if(x%j==0){
sum += j;
}
}
if(sum == i){
cout << i <<endl;
}
}
return 0;
}
标签:std,数字,int,完数,20000,main
From: https://www.cnblogs.com/tccjx/p/17652642.html