执行下面程序后,输出结果是( )。
int score = 60;
void update(int &score) {
score += 5;
}
int main() {
int score = 80;
update(score);
cout << score << " " << ::score;
return 0;
}
- A. 85 60
- B. 80 65
- C. 85 65
- D. 80 60
正确答案:A
int score = 60;
void update(int &score) {
score += 5;
}
int main() {
int score = 80;
update(score);
cout << score << " " << ::score;
return 0;
}
正确答案:A
想系统刷完 GESP C++ 1~8 级真题,并查看每道题的逐题精讲?
进入 GESPPASS 开始练习