题目链接http://codeforces.com/contest/722/problem/A
被样例3给坑了…* _ * ,果然英语不好吃亏..之后看大牛代码,感觉确实他们的代码真是简洁….ORZ,以后写代码风格向他们学习->_<-
#include <stdio.h>
int main() {
int f, h, m;
scanf("%d %d:%d", &f, &h, &m);
while (m > 59)
m -= 10;
if (f == 24) {
while (h > 23)
h -= 10;
} else if (f == 12) {
while (h > 12)
h -= 10;
if (h == 0)
h++;
}
printf("%02d:%02d", h, m);
}