• 2022-11-01
    在下列选项中,没有构成死循环的程序段是______。
    A:
    B: include <;iostream>;using namespace std;void main( ){ int i=2020; while(1) { i=i%100+1;if(i>;100)break; }}
    C:
    D: include <;iostream>;using namespace std;void main( ){ for(;;);}
    E:
    F: include <;iostream>;using namespace std;void main( ){ int i=36; while(i); --i;}
    G:
    H: include <;iostream>;using namespace std;void main( ){int i =10000;do{ ++i;}while(i>;=1000);}
  • D

    内容

    • 0

      下面的程序输出结果是( )。 #include<iostream> using namespace std; void add() static int x; x++; cout<<x<<’’; int main() for(int i=0;i<3;i++) add(); return 0; A: 111 B: 123 C: 222 D: 333

    • 1

      以下程序的输出结果是 。#include&#91;iostream&#93;#include&#91;iomanip&#93;using namespace std;void main(){ int i; for (i=1;i>=0;) cout<<i--;}

    • 2

      运行如下程序,结果为_____。#include <;iostream>;using namespace std;int main( ){int x =10; do { cout <;<; --x ; }while( !x ); return 0;}

    • 3

      使用标准命名空间的语句是( ); A: using namespace iostream; B: using namespace std; C: include std; D: include iostream;

    • 4

      写出下列程序的执行结果是:__________________。 #includeusing namespace std; void main() { int i = 1; while( i<;=10 ) if( ++i % 3 != 1 ) continue; else { cout <;<; i; if(i!=10) cout<;<;","; } }