填空题

下列程序的输出结果是 【10】 。
#include<iostream>
using nameSpace std;
int main()

int data=1;
int &r=data;
data+=5;
r+=5;
cout<<data<<end1;
return 0;

【参考答案】

K
<上一题 目录 下一题>
热门 试题

填空题
有以下程序 #include<iostream> using namespace std; class Base int a; public: Base(int x) a=x; vuid show()cout<<a; ; class DeriVed:public Base int b; public: Derived (int i):Base(i+1),b(i) void show()cout<<b; ; int main() Base b(5),*pb; Derived d(1); pb=&d; pb->show(); return 0; 运行后的打印结果是 【14】 。
填空题
在下面横线上填上适当的语句,完成程序。 #include<iostream> using namespace std; class Base int x; public: Base(int i)x=i; ~Base() ; class Derived:public Base public: ___________ 完成类Derive构造函数的定义 ; int main() Derived Obj; return 0; 在横线处应填入的语句是 【9】 。
相关试题
  • 已知int DBL(int n)return n+n;和lo...
  • 有如下程序: #inClude<iostream> usi...
  • 有以下面程序: #include<iostream> u...
  • 有以下程序 #include<iostream> using...