Analysis of the real test questions of C/C++ (Level 1) in December 2023#China Electronics Society#National Youth Software Programming Level Examination

Insert image description here

C/C++ Programming (Levels 1~8) All real questions・Click here

Question 1: Input and output of numbers

Input an integer and double-precision floating point number, first output the floating point number with 2 decimal places, and then output the integer.
Time limit: 1000
Memory limit: 65536
Input
Two numbers in one line, respectively an integer N (not exceeding the integer range) and a double-precision floating point number F, separated by a space.
Output:
Two numbers in one line, F, which is output with 2 decimal places, and an integer, N, separated by a space.
Sample input
100 123.456789
Sample output
123.46 100

Answer:
The following is a sample code for a number input and output program written in C language. According to the input integer and double-precision floating-point number, the floating-point number is first output with 2 decimal places, and then the integer is output:

#

Guess you like

Origin blog.csdn.net/gozhuyinglong/article/details/135422418