public class Main { public static void main(String[] args) { int count = 0; for (int i = 100; i < 1000; i++) { for (int j = 2; j < i / 2; j++) { if (i % j == 0) { count++; break; } } } System.out.print(900 - count); } }
public class Main { public static void main(String[] args) { int count = 0; for (int i = 100; i < 1000; i++) { for (int j = 2; j < i / 2; j++) { if (i % j == 0) { count++; break; } } } System.out.print(900 - count); } }