2025-2026学年CCF GESP认证 C 六级信息技术试卷(图片版,无答案)

资源下载
  1. 二一教育资源

2025-2026学年CCF GESP认证 C 六级信息技术试卷(图片版,无答案)

资源简介

GESP
CCF编程能力等级认证
Grade Examination of Software Programming
C++六级
2025年12月
1单选题(每题2分,共30分)
题号123456789101112131415
答案CC CA BB C AB B A C BBB
第1题在面向对象编程中,下列关于虚函数的描述中,错误的是()。
A虚函数用于支持运行时多态
口B.通过基类指针调用虚函数时,会根据对象实际类型决定调用版本
口C.构造函数可以声明为虚函数以支持多态
D,基类析构函数常声明为虚函数以避免资源泄漏
第2题执行如下代码,会输出钢琴:叮咚叮咚和吉他:咚咚当当。这体现了面向对象编程的()特性。
第1页/共13页
1 class Instrument
2
public:
virtual void play(){
4
coUt<<"乐器在演奏声音"<6
virtual ~Instrument(){
8
9
10
class Piano public Instrument
11
public:
12
void play()override
13
cout<<"钢琴:叮终叮终"<14
15
}:
16
17
class Guitar public Instrument
18
public:
19
void play()override
20
coUt<<"吉他:佟终当当"<21
22
}:
23
24
int main(){
Instrument*instruments[2];
26
instruments[e]new Piano();
27
instruments[1]new Guitar();
28
29
for (int i 0;i 2;++i){
30
instruments[i]->play();
31
33
for (int i 0;i<3;++i){
34
delete instruments[i];
35
36
return 0;
37
A.继承
B.封装
□C.多态
口D.链接
第3题关于以下代码,说法正确的是()。
第2页/共13页
1 class Instrument
2
public:
3
void play(){
4
coUt<<"乐器在演奏声音"<6
virtual ~Instrument(){
8
}
9
10
class Piano public Instrument
11
public:
12
void play()override
13
cout<<"钢琴:叮终叮终"<14
15
};
16
17
class Guitar public Instrument
18
public:
19
void play()override
20
coUt<<"吉他:佟终当当"<21
22
}:
23
24
int main(){
25
Instrument*instruments[2]
26
instruments[e]new Piano();
27
instruments[1]new Guitar();
28
29
for (int i 0;i 2;++i){
30
instruments[i]->play();
31
32
33
for (int i=0;i<3;++i){
34
delete instruments[i];
35
36
return 0;
37
A执行代码会输出两行,内容分别为:钢琴:叮咚叮咚和吉他:咚咚当当
口B.执行代码会输出两行,内容分别为:乐器在演奏声音和乐器在演妄声音
C.代码编译出现错误
口D.代码运行出现错误
第4题某文本编辑器把用户输入的字符依次压入栈S。用户依次输入A,B,C,D后,用户按了两次撤销(每次
撤销,弹出栈顶一个字符)。此时栈从栈底到栈顶的内容是:()。
A.AB
B.ABC
C.ABD
□D.Bc
第5题假设循环队列数组长度为N,其中队空判断条件为:front=rear,队满判断条件为:(rear+1)%
N==front,出队对应的操作为:front=〔Front+1)%N,入队对于的操作为:reaP=(rear+1)%
N。循环队列长度N=6,初始front=1,reaP=1,执行操作序列为:入队,入队,入队,出队,入队,入队,
则最终(front,rear)的值是()。
A.(2,5)
第3页/共13页

展开更多......

收起↑

资源预览