package com.company.Util;
import java.util.Scanner;
public class Test09 {
public static void main(String[] args) {
System.out.println("-------------------------------------");
//----------------------------------------------------------
Scanner scanner = new Scanner(System.in);
int m= scanner.nextInt();
while (true){
if(!(zhiyou(m))){
System.out.println("您输入的不是质数");
System.out.println("--------------------------");
System.out.println("请重新输入");
int kl= scanner.nextInt();
m=kl;
}else{
break;
}
}
if(zhiyou(m)){
zuixiao(m);
}
}
public static void zuixiao(int n){
while(true){
n++;
if(zhiyou(n)){
System.out.println(n);
break;
}
}
}
public static boolean zhiyou(int s){
boolean flag=true;
int i;
for(i=2;i<s;i++){
if(s%i==0){
return false;
}}
return true;
}
}