单项选择题

与以下程序段等价的是( )。
while

A.(a)

if
B.(b) continue;
c;

A. while(a)
if(!b) c;
B. while
C.(c)
if(!b) break; c;
C. while(c)
if(b) c;
D. while(a)
if(b) break; c;
<上一题 目录 下一题>
热门 试题

填空题
在下面的程序的横线处填上适当的语句,使该程序的输出为12。#include <iostream>using namespace std;class Basepublic: int a,b; Base(int i) a=i; ;class Derived: public Base int a;public: Derived(int x): Base(x),b(x+1) void show() 【13】 ; 输出基烃数据成员a的值。 cout<<b<<end1;;int main() Derived d(1); D. show(); return 0;
单项选择题
有如下程序:#include <iostream>using namespace std;class Baseprivate: char c;public: Base(char n):c(n) ~Base() cout<<c;;class Derived: public Baseprivate: char c;public: Derived(char n):Base(n+1),c(n) ~Derived() cout<<c;;int main() Derived obj(’x’); return 0;执行上面的程序将输出( )。
A.xy
B.yx
C.x
D.y
相关试题
  • 在下面的程序的横线处填上适当的语句,使该...
  • 【14】 允许用户为类定义一种模式,使得...
  • 请将下列类定义补充完整。class Base pub...
  • 重新定义标识符的作用域规定是外层变量被隐...
  • 阅读下面程序:#include <iostream.h>...