林老师 · 客观题题库 · GESP 三级 · 2024 真题
GESP 三级 · 2024 真题
三级 · 2024 真题 · 客观题 · 每题 2 分
真题 复刻
试卷编号OBJ-736250
题目总数25 题 · 50 分
试卷类型客观题
考生须知:
① 本卷为客观题单卷,合计 25 题 · 50 分 ,全部为客观题;
② 试卷右上角设有 「提交答卷」 与 「重置考试」 按钮,提交后系统自动判分并显示答题正确情况,请确认全部作答后再行提交;
③ 试卷不显示答案,提交后方可查看每题作答与正确答案的对照;
④ 答卷进度会保留在本地缓存中,刷新或再次打开仍可继续作答;
⑤ 本卷仅供学生练习使用;请勿用于其他用途;题面有问题请联系:i64coder@163.com。
当前筛选下没有题目
壹
客 观 题
25 QUESTIONS · 2 POINTS EACH
第 1 题
单选
☆
⧉
未作答
小杨父母带他到某培训机构给他报名参加 CCF 组织的 GESP 认证考试的第 1 1 1 级,那他可以选择的认证语言有( )种。
(2 分)
GESP 三级 2024-06 · 单选 第1题 | 知识点 信息学常识(CCF·NOI·GESP)、C++程序结构
第 2 题
单选
☆
⧉
未作答
下面流程图在 yr 输入 2024 2024 2024 时,可以判定 yr 代表闰年,并输出 2 月是 29 29 29 天,则图中菱形框中应该填入( )。
(2 分)
A (yr%400==0) || (yr%4==0)
B (yr%400==0) || (yr%4==0 && yr%100!=0)
C (yr%400==0) && (yr%4==0)
D (yr%400==0) && (yr%4==0 && yr%100!=0)
GESP 三级 2024-06 · 单选 第2题 | 知识点 流程图、逻辑运算、程序补全
第 3 题
单选
☆
⧉
未作答
一般默认 64 64 64 位计算机系统中整型变量(int)还是 32 32 32 位,则整数能够表示的数据范围是( )。
(2 分)
A 0 ∼ 2 32 − 1 0 \sim 2^{32}-1 0 ∼ 2 32 − 1
B 0 ∼ 2 31 − 1 0 \sim 2^{31}-1 0 ∼ 2 31 − 1
C − 2 31 ∼ 2 31 − 1 -2^{31} \sim 2^{31}-1 − 2 31 ∼ 2 31 − 1
D − 2 63 ∼ 2 63 − 1 -2^{63} \sim 2^{63}-1 − 2 63 ∼ 2 63 − 1
GESP 三级 2024-06 · 单选 第3题 | 知识点 整型、数据范围与溢出
第 4 题
单选
☆
⧉
未作答
下列代码将十进制转化成八进制,则横线上应填入( )。
01 #include <iostream>
02 using namespace std;
03
04 void decimal2octal(int decimal) {
05 int oct_number[100];
06 int i = 0;
07 while (decimal > 0) {
08 ____________
09 //在此处填入代码
10 }
11 for (int j = i - 1; j >= 0; j--) {
12 cout << oct_number[j];
13 }
14 cout << endl;
15 }
(2 分)
A
oct_number[i] = decimal % 8; decimal /= 8;
B
oct_number[i] = decimal / 8; decimal %/= 8;
C
oct_number[i++] = decimal % 8; decimal /= 8;
D
oct_number[i++] = decimal / 8; decimal %= 8;
GESP 三级 2024-06 · 单选 第4题 | 知识点 进制转换、八进制、程序补全
第 5 题
单选
☆
⧉
未作答
二进制数 101.11 101.11 101.11 对应的十进制数是( )。
(2 分)
A 6.5 6.5 6.5
B 5.5 5.5 5.5
C 5.75 5.75 5.75
D 5.25 5.25 5.25
GESP 三级 2024-06 · 单选 第5题 | 知识点 进制转换、二进制
第 6 题
单选
☆
⧉
未作答
下列流程图的输出结果是( )。
(2 分)
A 5 5 5
B 10 10 10
C 20 20 20
D 30 30 30
GESP 三级 2024-06 · 单选 第6题 | 知识点 流程图、程序阅读与输出推断
第 7 题
单选
☆
⧉
未作答
下列代码的输出结果是( )。
01 #include <iostream>
02 using namespace std;
03 int main() {
04 int a = 12;
05 int result = a >> 2;
06 cout << result << endl;
07 return 0;
08 }
(2 分)
GESP 三级 2024-06 · 单选 第7题 | 知识点 移位运算、程序阅读与输出推断
第 8 题
单选
☆
⧉
未作答
下列代码的输出结果是( )。
01 #include <iostream>
02 using namespace std;
03
04 int main() {
05 int a = 5;
06 int b = 10;
07 a = a ^ b;
08 b = a ^ b;
09 a = a ^ b;
10
11 cout << "a = " << a << ", b = " << b << endl;
12 return 0;
13 }
(2 分)
A a = 5, b = 10
B a = 5, b = 5
C a = 10, b = 5
D a = 10, b = 10
GESP 三级 2024-06 · 单选 第8题 | 知识点 位异或、程序阅读与输出推断
第 9 题
单选
☆
⧉
未作答
如果字符串定义为 char str[] = "GESP";,则字符数组 str 的长度为( )。
(2 分)
GESP 三级 2024-06 · 单选 第9题 | 知识点 字符数组、字符型
第 10 题
单选
☆
⧉
未作答
在下列代码的横线处填写( ),可以使得输出是"7"。
01 #include <iostream>
02 using namespace std;
03
04 int main() {
05 int array[5] = {3, 7, 5, 2, 4};
06 int max = 0;
07 for (int i=0; i<5; i++)
08 if (____________) // 在此处填入代码
09 max = array[i];
10 cout << max << endl;
11 return 0;
12 }
(2 分)
A max > array[i]
B max < array[i]
C max = array[i]
D 以上均不对
GESP 三级 2024-06 · 单选 第10题 | 知识点 一维数组、程序补全
第 11 题
单选
☆
⧉
未作答
小杨在做数学题,题目要求找出从 1 1 1 到 35 35 35 中能被 7 7 7 整除的数字,即 [ 7 , 14 , 21 , 28 , 35 ] [7, 14, 21, 28, 35] [ 7 , 14 , 21 , 28 , 35 ] ,则横线处应填入哪个代码?( )
01 #include <iostream>
02 using namespace std;
03 int main() {
04 int arr[35];
05 int count = 0;
06 for (int i = 1; i <= 35; i++) {
07 if (i % 7 == 0)
08 ____________
09 // 在此处填入代码
10 }
11
12 for (int i = 0; i < count; i++)
13 cout << arr[i] << endl;
14 return 0;
15 }
(2 分)
A arr[count++] = i;
B arr[i] = count++;
C arr[i] = count;
D arr[count] = count++;
GESP 三级 2024-06 · 单选 第11题 | 知识点 一维数组、程序补全
第 12 题
单选
☆
⧉
未作答
已知字符 '0' 的 ASCII 编码的十进制表示为 48 48 48 ,则执行下面 C++ 代码后,输出是( )。
01 #include <iostream>
02 using namespace std;
03 int main() {
04 string s = "0629" ;
05 int n = s.length();
06 int x = 0;
07 for (int i = 0; i < n; i++)
08 x += s[i];
09 cout << x << endl;
10 return 0;
11 }
(2 分)
A 17 17 17
B 158 158 158
C 209 209 209
D 316 316 316
GESP 三级 2024-06 · 单选 第12题 | 知识点 字符ASCII运算、ASCII码、程序阅读与输出推断
第 13 题
单选
☆
⧉
未作答
某小学男子篮球队招募新成员,要求加入球队的成员身高在 135 135 135 厘米以上(不含 135 135 135 厘米)。本次报名的人员有 10 10 10 人,他们的身高分别是 125 125 125 、127 127 127 、136 136 136 、134 134 134 、137 137 137 、138 138 138 、126 126 126 、135 135 135 、140 140 140 、145 145 145 。完善以下代码,求出本次球队能够招募到新成员的人数?( )
01 #include <iostream>
02 using namespace std;
03 int main() {
04 int arr[10] = {125, 127, 136, 134, 137, 138, 126, 135, 140, 145};
05 int count = 0;
06 for (int i=0; i<10; i++)
07 ____________
08 // 在此处填入代码
09
10 cout << count << endl;
11 return 0;
12 }
(2 分)
A count = arr[i]>135? 1: 0;
B count += arr[i]>135? 1: 0;
C count++;
D 以上都不对
GESP 三级 2024-06 · 单选 第13题 | 知识点 三目运算、一维数组、程序补全
第 14 题
单选
☆
⧉
未作答
下面可以正确输出 They're planning a party for their friend's birthday. 的 C++ 语句是?( )
(2 分)
A cout << 'They\'re planning a party for their friend'\s birthday." << endl;
B cout << "They\'re planning a party for their friend's birthday.'<< endl;
C cout << 'They're planning a party for their friend's birthday.'<< endl;
D cout << "They\'re planning a party for their friend\'s birthday." << endl;
GESP 三级 2024-06 · 单选 第14题 | 知识点 字符型、cin与cout
第 15 题
单选
☆
⧉
未作答
如果执行下面 C++ 代码后,输出的结果是"gesp ccf org cn",则横线上应填入哪个代码?( )
01 #include <iostream>
02 using namespace std;
03 int main() {
04 string str = "gesp.ccf.org.cn" ;
05 string delimiter = "." ;
06 string result="" ;
07
08 string token;
09 size_t found = str.find(delimiter);
10 while (found != string::npos) {
11 token = str.substr(0, found);
12 result += token;
13 result += " " ;
14 ____________ // 在此处填入代码
15 found = str.find(delimiter);
16 }
17
18 result += str;
19 result += " " ;
20
21 //最后一部分
22
23 cout << result << endl;
24 return 0;
25 }
(2 分)
A str = str.substr(found + delimiter.length(), str.length() - 1);
B str = str.substr(found, str.length());
C str = str.substr(found, str.length() -1);
D 以上都不对
GESP 三级 2024-06 · 单选 第15题 | 知识点 string类、程序补全
第 16 题
判断
☆
⧉
未作答
GESP 测试是对认证者的编程能力进行等级认证,同一级别的能力基本上与编程语言无关。
(2 分)
GESP 三级 2024-06 · 判断 第1题 | 知识点 信息学常识(CCF·NOI·GESP)、C++程序结构
第 17 题
判断
☆
⧉
未作答
整数 -6 的 16 16 16 位补码可用十六进制表示为 FFFA。
(2 分)
GESP 三级 2024-06 · 判断 第2题 | 知识点 补码、十六进制
第 18 题
判断
☆
⧉
未作答
补码的优点是可以将减法运算转化为加法运算,从而简化计算机的硬件设计。
(2 分)
GESP 三级 2024-06 · 判断 第3题 | 知识点 补码、原码
第 19 题
判断
☆
⧉
未作答
字符常量 '\0' 常用来表示字符串结束,和字符常量 '0' 相同。
(2 分)
GESP 三级 2024-06 · 判断 第4题 | 知识点 字符数组、字符型
第 20 题
判断
☆
⧉
未作答
(2 分)
GESP 三级 2024-06 · 判断 第5题 | 知识点 一维数组、数组越界
第 21 题
判断
☆
⧉
未作答
C++ 中可以对数组和数组的每个基础类型的元素赋值。
(2 分)
GESP 三级 2024-06 · 判断 第6题 | 知识点 一维数组、常量与变量
第 22 题
判断
☆
⧉
未作答
如果 a 为 int 类型的变量,且表达式 ((a | 3) == 3) 的值为 true,则说明 a 在从 0 0 0 到 3 3 3 之间(可能为 0 0 0 、可能为 3 3 3 )。
(2 分)
GESP 三级 2024-06 · 判断 第7题 | 知识点 位或、关系运算、程序阅读与输出推断
第 23 题
判断
☆
⧉
未作答
执行下面 C++ 代码后,输出的结果是 8 8 8 。
01 int a = 0b1010;
02 int b = 01100;
03 int c = a & b;
04 cout << c <<endl;
(2 分)
GESP 三级 2024-06 · 判断 第8题 | 知识点 位与、二进制、八进制、程序阅读与输出推断
第 24 题
判断
☆
⧉
未作答
执行下面 C++ 代码后,输出的结果不可能是 89781 89781 89781 。
01 #include <iostream>
02 #include <cstdlib> // 为了使用 rand() 和 srand()
03 #include <ctime> // 为了使用 time()
04
05 using namespace std;
06
07 int main() {
08 // 设置随机种子
09 srand(time(NULL));
10
11 int i = 1;
12 int s[5];
13 while (i <= 5) {
14 int a = rand() % 10;
15 if (a % 3 == (i + 1) % 3)
16 s[i++] = a;
17 }
18 for (int i = 1; i <= 5; i++)
19 cout << s[i];
20 cout << endl;
21 return 0;
22 }
(2 分)
GESP 三级 2024-06 · 判断 第9题 | 知识点 while循环、同余与模运算、程序阅读与输出推断
第 25 题
判断
☆
⧉
未作答
把整数 3025 3025 3025 从中剪开分为 30 30 30 和 25 25 25 两个数,此时再将这两数之和平方,计算结果又等于原数。( 30 + 25 ) × ( 30 + 25 ) = 55 × 55 = 3025 (30+25) \times (30+25) = 55 \times 55 = 3025 ( 30 + 25 ) × ( 30 + 25 ) = 55 × 55 = 3025 ,这样的数叫"雷劈数"。可以使用枚举的方法求出所有符合这样条件的四位数。
(2 分)
GESP 三级 2024-06 · 判断 第10题 | 知识点 枚举、算术运算