HW4.33

时间:2023-11-10 23:29:50

HW4.33

 public class Solution
 {
     public static void main(String[] args)
     {
         int sum;

         for(int i = 6; i < 10000; i++)
         {
             sum = 0;

             for(int j = 1; j < i; j++)
                 if(i % j == 0)
                     sum += j;

             if(sum == i)
                 System.out.print(i + " ");
         }
     }
 }

相关文章