#4643. 智汇少年编程邀请赛(模拟一)小高
智汇少年编程邀请赛(模拟一)小高
一、单选题
1.
执行以下代码后,输出结果是( )
#include <iostream>
using namespace std;
int main() {
int a = 3, b = 5;
cout << a + b * 2;
return 0;
}
{{ select(1) }}
- 16
- 13
- 10
- 11
2.
下列哪个是合法的变量名( )
{{ select(2) }}
- 2abc
- int
- score_1
- a-b
3.
执行以下代码后,x 的值为( )
int x = 10;
x += 3;
x--;
{{ select(3) }}
- 10
- 11
- 12
- 13
4.
下面哪个符号表示“并且”( )
{{ select(4) }}
- ||
- &&
- !
- ==
5.
下面程序运行后输出( )
#include <iostream>
using namespace std;
int main() {
int a = 8;
if(a > 5)
cout << "A";
else
cout << "B";
}
{{ select(5) }}
- A
- B
- 5
- 8
6.
for循环:
for(int i=1;i<=5;i++)
一共执行循环体多少次( )
{{ select(6) }}
- 4
- 5
- 6
- 无限次
7.
下面数组定义正确的是( )
{{ select(7) }}
- int a[5];
- int[5] a;
- array a[5];
- int a(5);
8.
执行程序后输出结果为( )
int a = 7;
int b = 2;
cout << a / b;
{{ select(8) }}
- 3
- 3.5
- 4
- 2
9.
以下哪个语句可以结束循环( )
{{ select(9) }}
- stop
- continue
- break
- end
10.
下面程序输出结果为( )
int s = 0;
for(int i=1;i<=3;i++)
s += i;
cout << s;
{{ select(10) }}
- 3
- 5
- 6
- 9
二、多选题
11.
下面哪些属于基本数据类型( )
{{ multiselect(11) }}
- int
- double
- string
- char
12.
关于 if 语句,下列正确的是( )
{{ multiselect(12) }}
- 可以没有 else
- 条件需要写在括号中
- if 后面必须写分号
- 可以嵌套使用
13.
下列哪些是循环语句( )
{{ multiselect(13) }}
- for
- while
- if
- do...while
14.
关于数组,下列正确的是( )
{{ multiselect(14) }}
- 数组下标从0开始
- 数组中的元素类型必须相同
- 数组长度可以随便改变
- 可以使用循环访问数组
15.
下面哪些运算符属于关系运算符( )
{{ multiselect(15) }}
- (>)
- (<)
- (==)
- (+=)
三、判断题
16.
C++ 中一条语句结束通常要写分号。
{{ select(16) }}
- 正确
- 错误
17.
while 循环至少会执行一次循环体。
{{ select(17) }}
- 正确
- 错误
18.
数组中的元素可以是不同类型。
{{ select(18) }}
- 正确
- 错误
19.
continue 的作用是跳过本次循环。
{{ select(19) }}
- 正确
- 错误
20.
“=”和“==”表示的意义相同。
{{ select(20) }}
- 正确
- 错误
相关
在下列比赛中:
粤公网安备44195502000195号