下面运行输出的结果为int s=3;for(int i=0;i<;5;i++){if(i==3){continue;}s++;}System.out.println(s);
举一反三
- 中国大学MOOC: 下面程序执行后的输出结果是( )。#include int main(){ int i=0,s=0; for (;;) { if(i==3||i==5) continue; if (i==6) break; i++; s+=i; }; printf(%d,s); return 0;}#include int main(){ int i=0,s=0; for (;;) { if(i==3||i==5) continue; if (i==6) break; i++; s+=i; }; printf(%d,s); return 0;}#include int main(){ int i=0,s=0; for (;;) { if(i==3||i==5) continue; if (i==6) break; i++; s+=i; }; printf(%d,s); return 0;}#include int main(){ int i=0,s=0; for (;;) { if(i==3||i==5) continue;
- 【单选题】下面程序执行后的输出结果是()。#include <stdio.h>int main(){int i=0,s=0;for (;;) {if(i==3||i==5) continue;if (i==6) break;i++; s+=i;};printf("%d",s); return 0;}#include <stdio.h>int main(){int i=0,s=0;for (;;) {if(i==3||i==5) continue;if (i==6) break;i++; s+=i;};printf("%d",s); return 0;}#include <stdio.h>int main(){int i=0,s=0;for (;;) {if(i==3||i==5) continue;if (i==6) break;i++; s+=i;};printf("%d",s); return 0;}#include <stdio.h>int main(){int i=0,s=0; A. 10 B. 13 C. 21 D. 死循环
- 下面程序的运行结果为:int i=1,s=3;do{ s+=i++;if(s%7==0) continue;else ++i;}while(s<;15);printf(“%d”,i);
- 下面程序运行的结果为int i,j,s=0;for(i=1,j=5;i<;j;i++,j--){s+=i*10+j;}System.out.println(s);
- int f() { static int i=0; int s=1; s+=i; i++; return s; } main() { int i,a=0; for(i=0;i<5;i++) a+=f(); printf(“%d ”, a); }输出结果为