public class Test {
public static void zhishu(int n) {
int i;
for (i = 2; i <= n / 2; i++) {
if (n % i == 0) {
System.out.println(n + "不是质数");
break;
}
}
if (i > n / 2)
System.out.println(n + "是质数");
}
public static void main(String[] args) {
int n = 55;
zhishu(n);
}
}