| # | Problem | Pass Rate (passed user / total user) |
|---|---|---|
| 11576 | Time conversion |
|
| 12366 | svool dliow |
|
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.
Sample Input Download
Sample Output Download
Tags
Discuss
Description
Given a 5 characters word, try to encrypt the string by reversing each alphabet.
That is,
'a' becomes 'z'.
'b' becomes 'y'.
'c' becomes 'x'.
...
'y' becomes 'b'.
'z' becomes 'a'.
ouo.
Input
Input contains only a line.
A 5 character word.
It's is guarantee that the word contains only lower case alphabet.
Output
Output contains only a line.
The encrypted word.
With a new line after.