1000 以内完数 请各位帮忙简化算法
#include "stdafx.h"#include <iostream>
using namespace std;
int main()
{ cout<<"1000以内的完数如下:"<<endl;
int a,b,i;
int t;
for(a=2;a<=1000;a++)
{t=0;
for(b=1;b<a;b++)
if(a%b==0)t=t+b;
if(t==a)
{cout<<a<<":";
cout<<"它的因数是:"<<" ";
for(b=1;b<a;b++)
if(a%b==0)cout<<b<<" ";
cout<<endl;
}
}
return 0;
}