填空题

下列程序的输出结果是 【10】 。
#include <iostream>
using namespace std;
void fun(int &rf)

rf*=2;

int main()

int num= 500;
fun(num);
cout<<num<<end1;
return 0;

【参考答案】

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

填空题
在下面程序的横线处填上适当的语句,使该程序的输出为12。 #include <iostream> using namespace std; class Base public: int a; Base(int i)a=i; ; class Derived: public Base int a; public: Derived(int x): Base(x),b(x+l) void show() 【11】 ;∥输出基类数据成员a的值。 cout<<b<<end1; ; int main() Derived d(1); d.show(); return 0;
填空题
设在主函数中有以下定义和函数调用语句,且fun()函数为void类型,请写出fun()函数的首部 【7】 。 int main() double s[10][22]; int n; … fun(s); … return 0;
相关试题
  • 下面程序的输出是: **********...
  • 下列程序将x、y和z按从小到大的顺序排列,...
  • 假定A为一个类,则语句A(A&a);为该类 ...
  • 若有以下程序段: #include <iostream...