using namespace std;
int main()
{
int i, j, k, sum = 0;
for (i = 1; i <= 1000; i++)
{
j = i;
sum = 0; //初始化
for (k = 1; k{
if (i%k == 0) sum += k; //是sum += k不是sum=+k啊
}
if (sum == i) cout << i << endl; //sum == i不是sum = i啊
}
cout << endl;
getchar();
return 0;
}