单项选择题

有以下程序:
#include <iostream>
using namespace std;
int main ()
int x=15;
while (x>10&&x<50)
x++;
if (x/3)

x++; break;

cout<<x<<endl;
return 0;
执行后的输出结果是

A.15
B.16
C.17
D.18
<上一题 目录 下一题>
热门 试题

单项选择题
下列类的定义中,有( )处语法错误。 class Base public: Base() Base(int i) data=i; private: int data; ; class Derive : public Base public: Derive() : Base(0) Derive (int x) d=x; void setvalue(int i) data=i; private: d; ;
A.1
B.2
C.3
D.4
单项选择题
有如下程序: #include <iostream> using namespace std; class BASE public: ~BASE()cout<< BASE ; ; class DERIVED:public BASE public: ~DERIVED()cout<< DERIVED ; ; int main()DERIVED x;return 0; 执行后的输出结果是
A.BASE
B.DERIVED
C.BASEDERIVED
D.DERIVEDBASE
相关试题
  • 下面是一个栈类的模板,其中push函数将元素...
  • 下列程序将x、y和z按从小到大的顺序排列,...
  • 多数运算符既能作为类的成员函数重载,也能...
  • 假定A为一个类,则语句A(A &a);为该类...
  • 在下面程序的横线处填上适当的语句,使该程...