幼儿园小跟班
public static void main(String[] args) { int sum=0; int prt = 0; for (int i = 100; i <= 200; i++) { for (int j = 2; j <= i; j++) { if (i % j == 0 && i != j) { break; } if (i % j == 0 && i == j) { System.out.print(i+" "); prt ++; if(prt%10 == 0) { System.out.println(); } sum+=i; } } } System.out.println("sum="+sum); }