Today marks the 899th day of learning programming with the cool drizzle!
Hello, everyone! This is the test for GESP202509 Level 2.
Day 899


GESP202509 Level 2
Multiple Choice Question
Question 11
Question 11: The following C++ code is used to record the maximum and minimum of multiple input numbers (input -999 to end input). Which of the following statements is incorrect?

A. If the first number input is -999, the output will be -999 -999
B. During the input process, if the first number input is not -999, and if there is no -999 in the subsequent inputs, the program can determine the maximum and minimum of the input integers
C. If used for inputting exam scores, where -999 cannot be a score, the program can determine the highest and lowest scores among the inputted scores
D. The statement can be moved to cin >> now_num; below while (now_num != -999) {, and the result will remain unchanged
Answer: D
START OF SPRING
Solution:This question tests the while loop.
This question refers to moving cin to the first line of the loop body on line 11. If a number greater than 0 is input outside the loop, and -999 is input for the first time in the loop, -999 will participate in the calculation and may be considered the minimum value, but -999 itself is not a valid number. This will lead to incorrect results.

20
25
11

NOVEMBER
Day
Monday
Tuesday
Wednesday
Thursday
Friday
Saturday
Sunday
1
12
2
13
3
14
4
15
5
16
6
17
7
Winter Begins
8
Chinese Journalist Day
9
Fire Safety Day
10
21
11
22
12
23
13
24
14
25
15
26
16
27
17
28
18
29
19
30
20
October
21
2nd
22
Light Snow
23
4th
24
5th
25
6th
26
7th
27
Thanksgiving
28
9th
29
10th
30
11th
Cool Drizzle
Cool Drizzle
Open Wisdom Station
