| # | Problem | Pass Rate (passed user / total user) |
|---|---|---|
| 11099 | Money Money |
|
| 11114 | 2016 CS Lab1-1 (Time conversion) |
|
Description
Jay, Jolin and JJ are three people.
All of them have some money.
1. Jay and Jolin have X dollors.
2. Jolin and JJ have Y dollors.
3. Jay and JJ have Z dollors.
How many dollars does each of them have?
Input
Three positive even integers, X, Y and Z.
Output
The output contains three positive even integers indicating the money of Jay, Jolin, and JJ.
There is a whitespace between any two integers and a newline character '\n' at the end of the line.
Sample Input Download
Sample Output Download
Tags
Discuss
Description
Please convert 24-h time format to 12-h time format .
Hint1:
You can define an integer called 'flag' to indicate a.m. or p.m.
And then you can use 'flag' to compute the key information : 'a' , 'p'
int key_info = 'a' * ((flag+1)%2) + 'p' * flag ;
key_info will be 'p' when flag is 1 , and be 'a' when flag is 0.
Hint2:
Note that 1200 belongs to p.m.
Namely, the output should be 00:00 p.m.
and 0000 belongs to a.m.
Namely, the output should be 00:00 a.m.
Input
always a 4-digit integer
Output
hour + ":" + minute + "whitespace" + "a.m." / "p.m."
(2-digit) (2-digit)
hour and minute numbers need to have 0 prepended if needded.
Note that there is no need to add "\n" at the end of output.