单项选择题

有以下程序:
#include <iostream>
using namespace std;
int main()

int x=15;
while(x>10&&x<50)

x++;
if(x/3)

x++; break;


cout<<x<<end1;
return 0;

执行后的输出结果是

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

单项选择题
以下程序的输出结果是 #include <iostream.h> void main() int a=0,i; for(i=1 ;i<5;i++) switch(i) case 0: case 3: a+=2; case 1: case 2: a+=3; default: a+=5; cout<<a<<end1; return;
A.31
B.13
C.10
D.20
单项选择题
有以下程序 #include <iostream> #include <string> using namespace std; class base private: char baseName[10]; public: base() strcpy(baseName, Base ); virtual char *myName() return baseName; char *className() Return baseName; ; class Derived: public base private: char derivedName[10]; public: Derived() strcpy(derivedName, Derived ); char *myName() return derivedName; char *className() return derivedName; ; void showPtr(base &p) cout<<p.myName()<< <<p.className(); int main() base bb; Derived dd; showPtr(dd); return 0; 运行后的输出结果为
A.Derived Base
B.Base Base
C.Derived Derived
D.Base Derived
相关试题
  • 有以下程序: class Date public: Dat...
  • 若有以下程序: #include <iostream>...