单项选择题

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

int a=5;b=4,c=3,d=2;
if(a>b>c)
cout<<d<<end1;
else if((c-1>:d) ==1)
cout<<d+1<<end1;
else
cout<<d+2<<end1;
return 0;

执行后的输出结果是( )。

A.2
B.3
C.4
D.编译时有错,无结果
<上一题 目录 下一题>
热门 试题

单项选择题
有以下程序: #include<iostream> #include<string> using namespace std; int main() char arr[2][4]; strcpy(arr[0], you ); strcpy(arr[1], me ); arr[0][3]=’&’; cout<<arr[0]<<end1; return 0; 执行后的输出结果是( )。
A.you&me
B.you
C.me
D.err
单项选择题
有如下程序: #include <iostream> using namespace std; class point int x, y; public: point( int vx, int vy ) x = vx; y = vy; point ( ) x = 0; y = 0; point operator+( point pl ) point p; int px = x + p1.x; int py = y + p1.y; return point( px, py ); point operator-( point p1 ) point p; int px = x - p1.x; int py = y - p1.y; return point( px, py ); void print() cout<<x<< , <<y<<end1; ; int main () point pl ( 10, 10 ), p2 ( 20, 20 ); p1 = p1 + p2; p1.print (); return 0; 执行后的输出结果是( )。
A.10,10
B.20,20
C.10,20
D.30,30
相关试题
  • 有以下程序: #include <fstream> #...
  • 下面程序的输出结果是 【13】 。 #in...
  • 若有以下程序: #include <iostream>...
  • 下面程序是一个堆栈的类模板,在横线处填上...
  • 实现编译时的多态性的机制称为 【10】 ...