public class WanShu {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
int i,j,s;
System.out.println("1000以内的完数有:");
for(i=2;i<=1000;i=i+1){
s=0;
for(j=1;j if(i%j==0) s=s+j;
if(i==s)
{
System.out.print("完数"+i+" 其因子是:");
for(j=1;j if(i%j==0&&j!=1)
System.out.print(j+" ");
else if(i%j==0&&j==1)
System.out.print(j+" ");}
System.out.println();}
}
}
}