Yr is on the English class,she is so sleepy that she want to know how long the class will last.So,she try to find out the current time.But the only clock is on the back wall of the classroom,and frequent turning might offend the teacher.
Clever as she is, Yr take out a mirror.Now,she can see the clock in the mirror.Unfortunately,the time in the mirror maybe not the real time.Now,it’s time for you to do her a favor.She will give you the time in the mirror and ask you to tell her the real time.
Clever as she is, Yr take out a mirror.Now,she can see the clock in the mirror.Unfortunately,the time in the mirror maybe not the real time.Now,it’s time for you to do her a favor.She will give you the time in the mirror and ask you to tell her the real time.
Multiple cases.
Each case shows in one line as the format: hh:mm
All legal time is show in 12 hours system.
Each case shows in one line as the format: hh:mm
All legal time is show in 12 hours system.
One line for each case.Please output the real time in 12 hours system according to the time given in the format hh:mm.If the time YR tell you is illegal,please out put ”That is a joke.”.
9:00 12:00
03:00 That is a joke.
【题解】
这道题,emmmm...哇了好几发,原因就是它的数据里分钟还能读出大于60的,,真的坑。
代码很简单。
【AC代码】
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<math.h>
#include<cmath>
using namespace std;
const int N = 20000;
int main()
{
int m,n;
while(~scanf("%d:%d",&m,&n))
{
int x,y;
if(m >=12||n>=60)
{
printf("That is a joke.\n");
continue;
}
if(n == 0)
{
x = 12-m;
y = 0;
}
else
{
x = 12-m-1;
y = 60-n;
}
printf("%02d:%02d\n",x == 12?0:x,y);
}
return 0;
}