未知题型
下面程序的输出结果是______。 include<iostream> using namespace std; int x; void funA(int&am
下面程序的输出结果是______。include<iostream>
using namespace std;
int x;
void funA(int&,int);
void funB(int,int&);
int main()
{
int first;
int second=5;
x=6;
funA(first,second);
funB(first,second);
cout<<first<<””<<second<<””<<x<<endl;
return 0;
}
void funA(int &a,int b)
{
int first;
first=a+b;
a=2*b;
b=first+4;
}
void funB(int u, int &v)
{
int second;
second=x;
v=second+4;
x=u+v;
}
【参考答案】
10 10 20
10 10 20 解析:本题考核函数的引用传递。“引用”实际上是给一个已知变量起个别名,对引用......
(↓↓↓ 点击下方‘点击查看答案’看完整答案 ↓↓↓)
点击查看答案
相关考题
