欢迎来到牛牛题库网 牛牛题库官网
logo

未知题型

下面程序的输出结果是______。 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 解析:本题考核函数的引用传递。“引用”实际上是给一个已知变量起个别名,对引用......

(↓↓↓ 点击下方‘点击查看答案’看完整答案 ↓↓↓)

点击查看答案

相关考题

单项选择题
1. Judas betrays Jesus When Jesus finished speaking all these words, he said to his disciples, “You know that the Passover is two days from now. And the Human One will be handed over to be crucified.” Then the chief priests and elders of the people gathered in the courtyard of Caiaphas the high priest. They were plotting to arrest Jesus by cunning tricks and to kill him. But they agreed that it shouldn’t happen during the feast so there wouldn’t be an uproar among the people. When Jesus was at Bethany visiting the house of Simon, who had a skin disease, a woman came to him with a vase made of alabaster containing very expensive perfume. She poured it on Jesus’ head while he was sitting at dinner. Now when the disciples saw it they were angry. But Jesus knew what they were thinking. He said, “Why do you make trouble for the woman? She’s done a good thing for me. You always have the poor with you, but you won’t always have me. By pouring this perfume over my body she’s prepared me to be buried. I tell you the truth that wherever in the whole world this good news is announced, what she’s done will also be told in memory of her.” Then one of the Twelve, who was called Judas Iscariot, went to the chief priests and said, “What will you give me if I turn Jesus over to you?” They paid him thirty pieces of silver. From that time on he was looking for an opportunity to turn him in.1.What can be inferred from the passage?
A、Judas was innocent and grateful.
B、The chief priests respected Jesus in a sincere way.
C、Jesus was assassinated in Passover.
D、The chief priests were plotting to arrest Jesus by cunning tricks and to kill him.
微信小程序免费搜题
微信扫一扫,加关注免费搜题

微信扫一扫,加关注免费搜题