100以内的等于因子之和的数
public class TwiceWork1 {
public static void main(String[ ]args){
for (int i = 2; i <= 1000; i++) {
int sum = 0;
for (int b = 1; b < i; b++) {
if(i%b==0)
{
sum+=b;
}
}
if (sum == i) {
System.out.println(i+" ");
}
}
}
}
100以内的等于因子之和的数
public class TwiceWork1 {
public static void main(String[ ]args){
for (int i = 2; i <= 1000; i++) {
int sum = 0;
for (int b = 1; b < i; b++) {
if(i%b==0)
{
sum+=b;
}
}
if (sum == i) {
System.out.println(i+" ");
}
}
}
}