public class Tu2{
public static void main(String[] args){
int n = 500;
compNumber(n);
}
private static void compNumber(int n){
int count = 0;
System.out.println(n+"以内的完数:");
for(int i=1;i
for(int j=1;j if((i%j)==0){
sum += j;
if(sum==i){
System.out.print(i+" ");
if((count++)%5==0)
System.out.println();
}
}
}
}
}
}