• 2022-06-12
    下面运行输出的结果为int s=3;for(int i=0;i<;5;i++){if(i==3){continue;}s++;}System.out.println(s);
  • 7

    内容

    • 0

      下面程序执行后的输出结果是()。#includeintmain(){inti=0,s=0;for(;;){if(i==3||i==5)continue;if(i==6)break;i++;s+=i;};printf("%d",s);return0;}‍#includeintmain(){inti=0,s=0;for(;;){if(i==3||i==5)continue;if(i==6)break;i++;s+=i;};printf("%d",s);return0;}#includeintmain(){inti=0,s=0;for(;;){if(i==3||i==5)continue;if(i==6)break;i++;s+=i;};printf("%d",s);return0;}#includeintmain(){inti=0,s=0;for(;;){if(i==3||i==5)continue;if(i==6)break;i++;s+=i;};printf("%d",s);return0;} A: 10 B: 13 C: 21 D: 死循环

    • 1

      以下程序的运行结果是 inti = 0, s = 0; for( ; ; ) { if(i == 3 || i == 5) continue; if(i == 6) break; i++;s += i; } printf("%d",s);

    • 2

      下面代码段的执行结果是 int i, s = 0 ; int a[ ] = { 10 , 20 , 30 , 40 , 50 , 60 , 70 , 80 , 90 }; for ( i = 0 ; i < a.length ; i ++ ) if ( a[i]%3 = = 0 ) s += a[i] ; System.out.println("s="+s);

    • 3

      下面程序段的运行结果是_____。#includeiostreamusing namespace std;int main(){ int i=1,s=3; do {s+=i++; if (s%7==0) continue; else ++i;} while(s15); couti;}

    • 4

      有以下程序: int main() { int i,s=1; for(i=1 ;i<=50 ;i++) if( !(i%5)&& !(i%3)) s+=i; printf(“%d\n”,s); return 0; } 程序的输出结果是( )