#10980. 2025年信息素养大赛初赛-客观题(小学组)

0

2025年信息素养大赛初赛-客观题(小学组)

一、单项选择题(每题5分,共15题,75分)

第1题

在C++中,表示逻辑运算符"或"的是?

{{ select(1) }}

  • ||
  • &
  • ==
  • @

第2题

执行下列代码,输入3,输出结果为?

#include<iostream>
using namespace std;
int main(){
    int n;
    cin >> n;
    cout << n - 3;
    return 0;
}

{{ select(2) }}

  • -n
  • 0
  • 9
  • 81

第3题

下列选项中,输出结果为0的是?

{{ select(3) }}

  • cout << "5 - 5";
  • cout << 5 - 5;
  • cout << 2 * 3;
  • cout << 7 / 2;

第4题

执行以下程序段,输入 30 50,输出的结果为?

int a, b;
cin >> a >> b;
if(a > b) {
    cout << a;
}
else {
    cout << b;
}

{{ select(4) }}

  • 30
  • 50
  • 30 50
  • 无输出

第5题

在C++中,a = a - b 可以简写为 a -= b。执行下列代码,输出结果为?

int a = 18;
a -= 9;
cout << a;

{{ select(5) }}

  • 2
  • -6
  • 9
  • 1

第6题

下列选项中,可以判断变量 n 为偶数的是?

{{ select(6) }}

  • n % 1 == 0
  • n % 2 == 0
  • n % 5 == 0
  • n % 7 == 0

第7题

执行以下程序,输出的结果是?

int array[3] = {4, 5, 6};
array[0] = array[0] - 3;
cout << array[0] << " " << array[1] << " " << array[2];

{{ select(7) }}

  • 4 5 6
  • 1 5 6
  • 4 2 6
  • 4 5 3

第8题

现有数组定义为 int num[4] = {6};,则数组 num 中的元素分别是?

{{ select(8) }}

  • 6 6 6 6
  • 0 0 0 0
  • 6 0 0 0
  • 0 0 0 6

第9题

下面程序段输出的结果是?

char upper = 'A';
char lower = upper + 32;
cout << lower;

{{ select(9) }}

  • A
  • a
  • 65
  • 97

第10题

执行下列代码,输出结果为?

for (int i = 1; i <= 5; i++) {
    if (i % 2 == 0) {
        continue;
    }
    cout << i << " ";
}

{{ select(10) }}

  • 1
  • 2 4
  • 1 3 5
  • 1 2 3 4

第11题

小明同学想判断输入的年份 x 是否是闰年,是则输出 Yes,否则输出 No。下面程序段中①处应该填写?

int x;
cin >> x;
if (_①_) {
    cout << "Yes";
} else {
    cout << "No";
}

{{ select(11) }}

  • x%4000 && x%40 && x%100!=0
  • %4000 && x%40 || x%100!=0
  • x%4000 || x%40 || x%100!=0
  • (x%4000) || (x%40 && x%100!=0)

第12题

运行以下程序,输入6,输出的结果是?

#include <iostream>
using namespace std;
int main() {
    int n;
    cin >> n;
    if (n % 2 == 0) {
        cout << "QWER";
    } else if (n % 3 == 0) {
        cout << "WERQ";
    } else if (n % 5 == 0) {
        cout << "ERQW";
    } else {
        cout << "RQWE";
    }
    return 0;
}

{{ select(12) }}

  • QWER
  • WERQ
  • ERQW
  • RQWE

第13题

下图为 n=5 时输出的图案,输入一个正整数 n,输出一个 n+1 行特殊的直角三角形,则①处应补充的代码为?

*
**
****
******
**********
**********
int n;
cin >> n;
cout << "*" << endl;
for (int i = 1; i <= n; i++) {
    for (int j = 1; _①_; j++) {
        cout << "*";
    }
    cout << endl;
}

{{ select(13) }}

  • j <= 2 * i
  • j <= i
  • j <= 2 * i - 1
  • j <= 2 * i + 1

第14题

阅读以下代码,输出的内容是?

#include <iostream>
using namespace std;
int main() {
    for(int i = 1; i <= 4; i++) {
        for(int j = 5; j >= 1; j--) {
            cout << j << " ";
        }
        cout << endl;
    }
    return 0;
}

{{ select(14) }}

  • 1 2 3 4 5(重复4行)
  • 5 4 3 2 1(重复4行)
  • 1 2 3 4(重复4行)
  • 5 4 3 2 1(重复3行)

第15题

阅读程序,当输入7,程序输出的结果为?

#include<iostream>
using namespace std;
int main() {
    int n;
    int a[51] = {};
    cin >> n;
    a[1] = 1;
    for(int i = 2; i <= n; i++) {
        a[i] = a[i-1] * 2 + 1;
    }
    cout << a[n];
    return 0;
}

{{ select(15) }}

  • 63
  • 97
  • 115
  • 127

二、判断题(每题5分,共5题,25分)

第16题

在C++中,&& 表示逻辑运算符"或"。

{{ select(16) }}

  • 正确
  • 错误

第17题

在C++中,可以通过这种方式定义数组并初始化:int c[3] = {1, 2, 3, 4, 5};

{{ select(17) }}

  • 正确
  • 错误

第18题

在C++语言中,一维数组的下标是从0开始。

{{ select(18) }}

  • 正确
  • 错误

第19题

定义 int arr[10]; 后,执行 arr[10] = 5; 不会导致数组越界。

{{ select(19) }}

  • 正确
  • 错误

第20题

下面代码段最终的值是-1。

int i = 5;
while(i > 0) {
    i -= 2;
}

{{ select(20) }}

  • 正确
  • 错误