http://202.121.199.212/JudgeOnline/problem.php?cid=1079&pid=18
分析: 时间加法
代码:
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <string>
#include <string.h>
#include <ctype.h>
#include <math.h>
using namespace std;
int main()
{
int n;
int ah,am,as;
int bh,bm,bs;
int h,m,s;
scanf("%d",&n);
while(n--){
h=0,m=0,s=0;
scanf("%d%d%d%d%d%d",&ah,&am,&as,&bh,&bm,&bs);
s=as+bs;
if(s>=60){
s -=60;
m++;
}
m +=am+bm;
if(m>=60){
m -=60;
h++;
}
h +=ah+bh;
printf("%d %d %d\n",h,m,s);
}
return 0;
}