說RE (SIGKILL)
執行時期錯誤產生立即終止訊號!! Killedimport java.util.Scanner; public class JAVA {public static void main(String[] args) {Scanner IN = new Scanner(System.in);int a = 1, c = 0;while (true) {int b = IN.nextInt();while (a <= b) {if (b % a == 0) {c = c + 1;}a = a + 1;}if (c == 2) {System.out.println("質數");} else {System.out.println("非質數");}}}}
我用netbeans都可以執行判斷是否為質數也沒有問題
為何他會說我執行時期錯誤??
說RE (SIGKILL)
執行時期錯誤產生立即終止訊號!! Killedimport java.util.Scanner; public class JAVA {public static void main(String[] args) {Scanner IN = new Scanner(System.in);int a = 1, c = 0;while (true) {int b = IN.nextInt();while (a <= b) {if (b % a == 0) {c = c + 1;}a = a + 1;}if (c == 2) {System.out.println("質數");} else {System.out.println("非質數");}}}}
我用netbeans都可以執行判斷是否為質數也沒有問題
為何他會說我執行時期錯誤??