题目描述

Write a program with a class clock. It allows user to input the current time (24-hours format, using constructor). It has two member functions, one is to display the current time in 24-hours format, and the other one is to display the current time in 12-hours format.


输入格式

the range of input time is 00:00:00~23:59:59.


输出格式

24-hour format
hour:minute:second
12-hour format
(00:00:00~11:59:59)
hour:minute:second a.m.
(12:00:00~23:59:59)
hour:minute:second p.m.


样例数据

输入

12 20 32

输出

12:20:32
12:20:32 p.m.

备注

The main function is provided, you only need to complete the Clock Class:

int main(){
    int hour,minute,second;
    cin>>hour>>minute>>second;
    Clock clock(hour,minute,second);
    clock.showin24();
    clock.showin12();
}

操作

评测记录

优秀代码

信息

时间限制: 1s
内存限制: 128MB
评测模式: Normal

题解