您的位置:首页 > 其它

HDU 4510 小Q系列故事——为什么时光不能倒流

2013-05-04 12:18 232 查看
水题.

#include <iostream>
#include <cstdio>
#include <memory.h>
using namespace std;
int H, M, S;
int main(){
int t;
scanf("%d", &t);
while (t--){
int h, m, s;
scanf("%d:%d:%d %d:%d:%d", &H, &M, &S, &h, &m, &s);
if(S<s){
M--;
}
S = (S - s + 60) % 60;
if(M < 0){
H--;
M = 59;
}
if(M < m){
H--;
}
M = (M - m + 60) % 60;
h %= 12;
if(H < 0){
H = 11;
}
H = (H - h + 12) % 12;
printf("%02d:%02d:%02d\n", H, M, S);
}
return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: