Today is the 825th day of learning programming with a slightly cool rain!
Hello, everyone! This is the CSP 2024 Group J Preliminary Exam Questions.
Day 825


CSP 2024 Group J Preliminary Exam Questions
Read the program
3. Complete the program (multiple choice questions, 3 points each, total 30 points)
Question 1
(Determine Perfect Square) Problem: Given a positive integer n, determine whether this number is a perfect square, i.e., there exists a positive integer x such that x squared equals n.
Please complete the program.

Fill in ( ) at position ① A. 1 B. 2 C. 3 D. 4
Fill in ( ) at position ② A. (int)floor(sqrt(num))-1 B. (int)floor(sqrt(num)) C. floor(sqrt(num/2))-1 D. floor(sqrt(num/2))
Fill in ( ) at position ③ A. num = 2 * i B. num == 2 * i C. num = i * i D. num == i * i
Fill in ( ) at position ④ (this question has multiple possible options) A. num = 2 * i B. num == 2 * i C. true D. false
Fill in ( ) at position ⑤ A. num = i * i B. num != i * i C. true D. false
Answers:
START OF SPRING
Solution: This question tests the use of functions in C++.
Answers;
1. A
Explanation: A perfect square needs to start trying from 1. Choose A.
2. B
Explanation: Try until the square root ends, choose B.
3. D
Explanation: It must be n == i * i, only under this condition is it a perfect square.
4. C
Explanation: Return true. Choose C.
5. D
Explanation: Return false, choose D.

20
25
8

AUGUST
Day
Monday
Tuesday
Wednesday
Thursday
Friday
Saturday
Sunday
1
Army Day
2
9th Day of the Month
3
10th Day of the Month
4
11th Day of the Month
5
12th Day of the Month
6
13th Day of the Month
7
Beginning of Autumn
8
National Fitness Day
9
Last of the Heat
10
17th Day of the Month
11
18th Day of the Month
12
19th Day of the Month
13
20th Day of the Month
14
21st Day of the Month
15
22nd Day of the Month
16
23rd Day of the Month
17
24th Day of the Month
18
25th Day of the Month
19
Doctor’s Day
20
27th Day of the Month
21
28th Day of the Month
22
29th Day of the Month
23
End of Heat
24
2nd Day of the Month
25
3rd Day of the Month
26
4th Day of the Month
27
5th Day of the Month
28
6th Day of the Month
29
Qixi Festival
30
8th Day of the Month
31
9th Day of the Month
@秀米XIUMI
With a slightly cool rain
Open Wisdom Station
