//输出三位数中所有的完数
#include<iostream>
using namespace std;
int main()
{
int sum;
for (int n = 1;n < 1000;n++)
{
sum = 0;
for (int i = 1;i <= (n / 2);i++)
{
if (n % i == 0)
{
sum = sum + i;
}
}
if (sum == n)
{
cout << n << "是完数" << endl;
for (int j = 1;j < n;j++)
{
if (n % j == 0)
{
cout << j << " ";
}
}
cout << endl;
}
system("pause");
}