#include <stdio.h>
int main()
{
int tst, h, m, time;
scanf("%d",&tst);
while (tst--)
{
scanf("%d:%d",&h,&m);
time = h*60 + m;
if (time>720) time-=720;
time = 720-time;
h = (time/60);
m = time%60;
if (!h) h = 12;
if (h<10)
printf("0%d:",h);
else
printf("%d:",h);
if (m<10)
printf("0%d\n",m);
else
printf("%d\n",m);
}
return 0;
}
Friday, October 21, 2011
[UVa] 11650 - Mirror Clock
Nice and fun! The only tricky case probably is a time that generated 0 hours, just make it 12 but keep the minute same. I don't know if handling for 24 hours time is needed but added that too.
Subscribe to:
Post Comments (Atom)
Connect Rapoo MT750S with Linux (Tested on Manjaro)
I bought this obvious copy of MX Master 2S in hopes of having the device switching functionality along with a lightweight body because I ha...
-
I like coding a lot, keeps me glued to the PC for hours. For that reason it's a need to edit the Syntax Highlighter to suit my eyes for...
-
I bought this obvious copy of MX Master 2S in hopes of having the device switching functionality along with a lightweight body because I ha...
-
Method: The problem at first glance seems too straightforward but it's not that much. Think a bit about the lines "Erin can add ...
No comments:
Post a Comment
Post your comment here. If you want to say something about programming problems, scripts, software etc, please try to be as descriptive as possible.