单项选择题

下面程序输出的结果是( )。
#include <iostream>
using namespace std;
void swap(int &a,int &b)
int temp;
temp=a;
a=b;
b=temp;
void main()
int x=2;
int y=3;
swap(x,y);
cout<<x<<y;

A.23
B.32
C.ab
D.ba
<上一题 目录 下一题>
热门 试题

单项选择题
根据下面的程序,可以在主程序中使用的合法语句是( )。 #include <iostream> using namespace std; class Person int age; public: void SetAge(int x)age=x; void ShowAge()cout<< the Person’s age is <<age; ; class Student:private Person public:int study_code; ; void main() Student wangqiang; wangqiang.study_code=23;
A.wangqiang.age=231
B.wangqiang.Setage(23)
C.wangqiang.ShowAge()
D.wangqiang.study_code=12
单项选择题
应在下面程序下划线中填写的正确的语句是( )。 #include <iostream> using namespace std; class A public: void test()cout<< this is A! ; ; class B:public A void test() ______ 显示调用基类函数test() cout<< this is B! ; ; void main()
A.A::test()
B.test()
C.B::test()
D.this->test()
相关试题
  • 线性表是一个具有n个()的有限序列。
  • 不能重载的运算符是( )。
  • 下面关于数组的初始化正确的是( )。
  • 以下不是数据库系统组成部分的是( )。
  • 下列关于重载函数的调用时选择的依据中,错...