输入一个数找大于它最小质数!!!

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;






        }
    }

 

posted @ 2023-03-14 20:35  22软工冷薄  阅读(27)  评论(0编辑  收藏  举报