/* 檔名:ch4_18.java 功能:continue敘述的示範 */
package myJava.exercise.ch04;
import java.lang.*;
public class ex4_02c //主類別
{
public static void main(String args[])
{
int i, j, k;
for (i = 2; i <= 100; i++)
{
for (j = 2; j < i; j++)
{
if (i % j == 0)
break;
}
if (j >= i)
for (k = 1; k<= 5; k++)
{
System.out.print(i+ "\t");
if(k==5)
System.out.println();
}
}
}
}
※程式碼:
※錯誤訊息:
※補充說明:
2 2 2 2 2
3 3 3 3 3
5 5 5 5 5
7 7 7 7 7
11 11 11 11 11
13 13 13 13 13
17 17 17 17 17
19 19 19 19 19
23 23 23 23 23
29 29 29 29 29
31 31 31 31 31
37 37 37 37 37
41 41 41 41 41
43 43 43 43 43
47 47 47 47 47
53 53 53 53 53
59 59 59 59 59
61 61 61 61 61
67 67 67 67 67
71 71 71 71 71
73 73 73 73 73
79 79 79 79 79
83 83 83 83 83
89 89 89 89 89
97 97 97 97 97
錯在那???