单项选择题
有以下程序:
#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 O;
执行后的输出结果是( )。
A.2
B.3
C.4
D.编译时有错,无结果
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
单项选择题
有以下程序: #include <iostream> using namespace std; int s=0; class sample static int n; public: sample (int i) n=i; static void add() s+=n; ; int sample::n=0; int main () sample a(2) ,b(5); sample::add(); cout<<s<<end1; return 0; 执行后的输出结果是( )。
A.2
B.5
C.7
D.3
点击查看答案&解析
单项选择题
有以下程序: #include <iostream.h> void sort(int L[],int n) int j, k, flag, temp; flag=n-1; while (flag>O) k=flag-1; flag=O; for (j=O; j<=k; j++) if(L[j]>L[j+1]) temp=L[j];L[j]=L[j+1]; L[j+1] =temp; flag=j; void main() int array[4]=2, 1,3,0; sort (array, 4); for (int i=O; i<4; i++) cout <<array[i]; cout <<end; 程序执行后的输出结果是( )。
A.0123
B.3210
C.2130
D.1230
点击查看答案&解析
相关试题
有如下的类的模板定义: template <clas...
设文件temp.txt 已存在,则以下的打印结...
若要把类 FriendClass 定义为类 MyClass...
有以下程序: #include <iostream> u...
有以下程序: #include <iostream> u...