importjava.util.Scanner;publicclassPrime{publicstaticvoidmain(Stringargs[]){inti;System.out.println(请输入一个整数);Scannerinput=newScanner(System.in);intnum=input.nextInt();for(i=2;inum;i++){if(num%i==0)break;}if(num==i)System.out.println(num+为素数);elseSystem.out.println(num+不是素数);}}