C语言基础试题(国外英文资料)
C语言基础试题
Display a short sentence "Programming in C is fun!" on the screen.
Input integer a and b, calculate and output a, b, and the difference.
Ex. :
So that's the parenthesis.
The input
2-8 -
The output
Negative 6, 10 (and 6, 10)
Enter 1 real x, calculate and output the square root (keep 1 bit of decimal).
Ex. :
The input
17
The output
4.1
Enter Fahrenheit temperature f, calculate and output the corresponding Celsius c (keep 2 decimal places). C is equal to 5/9 times f minus 32.
Example: the parenthesis is the explanation
The input
17.2 (Fahrenheit)
The output
8.22
Enter two integers, time1 and time2, to indicate the departure time and arrival time of the train, and to calculate and output the journey time.
The effective time range is 0000 to 2359, and you do not need to consider the departure time later than the arrival time.
Example: the parenthesis is the explanation
The input
712 1411 (the departure time is 7:12, the arrival time is 14:11)
The output
The train journey time is 6 HRS 59 mins.
Enter a four-digit number to encrypt the output. Method is to add 9 figures on the number of each, and divide it by more than 10 take, as the number of new on the bit, the last will be first and the third the Numbers on the swap, the Numbers in the second and fourth swaps, composed the encrypted new number.
Example: the parenthesis is the explanation
The input
1257
The output
The encrypted number is 4601 (The number of each digit plus 9 divided by 10 is 0146, which is 4601 after The exchange)
Type in a capital English letter and output the appropriate lowercase letter.
Ex. :
The input
G
The output
g
Enter a student's math score if it is below 60 and output "Fail", otherwise the output "Pass".
Ex. :
The input
60
The output
Pass
The input
59
The output
Fail
Enter four integers and output the minimum.
Example: the parenthesis is the explanation
The input
12 June 1, 90
The output
Min is 1 (the minimum value in 12, 6, 1, 90 is 1)
Tip: do not output any other non-relevant symbols