package _06_循环练习;

import java.util.Scanner;

public class Test2 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请录入一个数字");

        int number = scanner.nextInt();
        boolean flag = false;
        for (int i = 2; i < number; i++) {
            if(number % i == 0){
               flag = true;
               break;
            }
        }
        if(flag){
            System.out.println("这是不是一个质数");
        }else{
            System.out.println("这是一个质数");
        }
    }
}
