看着这么简单一道题那些答案里的花里胡哨还是贴了上来。。。 public class TotalNum { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while (sc.hasNext()){ int a = sc.nextInt(); int count = 0; for (int i = 2; i <= a; i++) { if (aaa(i)){ count++; } } System.out.println(count); } } public static bo...