Time limit per test
2 seconds
Memory limit per test
256 megabytes
Input
Standard Input
Output
Standard output
Tattah is asleep if and only if tattah is attending a lecture. This is a well-known formula among tattah's colleagues.
On a Wednesday afternoon, tattah was attending serving sor HH's lecture. At, right before falling asleep, he was staring at the digital watch
Around und Saher's wrist. He noticed that the digits on the clock were the same when read from both directions I. e. a palindrome.
In his sleep, he started dreaming about such rare moments of the day when the time displayed on a digital clock is a palindrome. as soon as he woke up, he felt destined to write a program that finds the next such moment.
However, he still hasn't mastered the skill of programming while sleeping, so your task is to help him.
Input
The first and only line of the input starts with a string with the format "HH: mm" where "hh"
Is from "00" to "23" and "mm"
Is from "00" to "59". Both
"Hh" and "mm" have exactly
Two digits.
Output
Print the palindromic time of day that comes soonest after the time given in the input. If the input time is palindromic, output the soonest palindromic time after the input time.
Sample test (s) Input
12:21
Output
13:31
Input
23:59
Output
00:00
Solution Description: This question is similar to a text return string, but only for specific time display. You can cycle from the current time until you find the time that meets the requirements. Pay attention to carry.
#include<iostream>#include<map>#include<string>#include<algorithm>#include<cstdio>#include<cmath>using namespace std;int main(){int h,m;char c;cin>>h>>c>>m;while (1>0){ m++;h+=(m/60);m%=60;h%=24;if (h/10==m%10 && h%10==m/10){break;}}cout<