紅色部分是我幫你修正的
import java.util.*;
public class Text7 {
public static void main(String[] args) {
// TODO Auto-generated method stub
int number;
int finaly;
int point;
Scanner cin = new Scanner(System.in);
while(cin.hasNext()) {
number = cin.nextInt();
point = ((int)Math.sqrt(number));
int i;
for(i=2;i<=point;i++) {
if(number%i == 0) {
System.out.println("非質數");
break;
}
}
if(i>point)
System.out.println("質數");
}
}
}