/* 输出大于某个正整数n的最小的质数 */ class 大于n的最小质数 { public static void main(String[] args) { java.util.Scanner s = new java.util.Scanner(System.in); System.out.print("请输入任意一个正整数;"); int num = s.nextInt(); int num1 = num + 1; while (true){ if (shiFouZhiShu(num1)) { System.out.println("大于" + num + "的最小质数是:" + num1); return; } num1 ++; } } public static boolean shiFouZhiShu(int num) { for (int i = 2; i < num; i++) { if (num % i == 0) { return false; } } return true; } }