goto和带标签的break、continue
作者:互联网
//带标签的break和continue
//打印101-150之间所有的质数(只能别1和自身整除的数叫做质数)
public static void main(String[] args) {
outer:for (int i = 101;i<150;i++){
for (int j = 2;j < i/2;j++){
if (i % j == 0){
continue outer;
}
}
System.out.print(i+" ");
}
}
标签:outer,goto,int,质数,break,continue,101 来源: https://www.cnblogs.com/huatian007/p/16063575.html