河南成教 / 河南理工大学
23[分析题]
public class BreakAndContinue {
public static void main(String[] args) {
for(int i = 0; i < 100; i ) {
if(i == 74) break; // Out of for loop
if(i % 9 != 0) continue; // Next iteration
System.out.println(i);
}
int i = 0;
// An "infinite loop":
while(true) {
i ;
int j = i * 27;
if(j == 1269) break; // Out of loop
if(i % 10 != 0) continue; // Top of loop
System.out.println(i);
}
}
}
上面程序执行后的结果是?
23[分析题]
public class BreakAndContinue {
public static void main(String[] args) {
for(int i = 0; i < 100; i ) {
if(i == 74) break; // Out of for loop
if(i % 9 != 0) continue; // Next iteration
System.out.println(i);
}
int i = 0;
// An "infinite loop":
while(true) {
i ;
int j = i * 27;
if(j == 1269) break; // Out of loop
if(i % 10 != 0) continue; // Top of loop
System.out.println(i);
}
}
}
上面程序执行后的结果是?
参考答案:
佳题速递: