import java.util.Scanner; public class Text2 { public static void main(String[] args) { Scanner x = new Scanner(System.in); int a = x.nextInt(); a+=1; int result = Text2.suShuPanDuan(a); System.out.println(result); } static int suShuPanDuan(int a) { int i; for (i = 2; i <= a / 2; i++) { if (a % i == 0) { a++; } } return a; } }
标签:Scanner,int,质数,数找,System,最小,static From: https://www.cnblogs.com/lengbo/p/17216278.html