在下列选项中,没有构成死循环的程序段是______。
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);}
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
举一反三
- 以下程序的输出结果是 。#include<;iostream>;#include<;iomanip>;using namespace std;void main(){ int i; for (i=1;i>;=0;) cout<;<;i--;}
- 下面程序的输出结果是( )。 #include<iostream> using namespace std; void main() int i=1; while(i<=8) if(++i%3!=2)continue; else cout<<i; A: 369 B: 258 C: 36 D: 25
- 下面程序的输出结果是( )。 #include<iostream> using namespace std; void main() int i=1; while(i<=8) if(++i%3!=2)continue; else cout<<i; A: A) 369 B: B) 258 C: C) 36 D: D) 25
- 下列程序的运行结果是____。#include <;iostream>;using namespace std;union{int i;char x[2];}a;void main(){a.x[0] = 10; a.x[1] = 1;cout<;<;a.i<;<;endl;}
- 写出下列程序的执行结果是:__________________。 #include using namespace std; void main() { int i; for( i=100; i<=200; i++ ) { if ( ( i % 3 == 2) && ( i % 5 == 3 ) && ( i % 7 == 2 ) ) cout << i << endl; } }
内容
- 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[iostream]#include[iomanip]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<;<;","; } }