题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2033
//C++代码
#include<iostream>
using namespace std;
int main(){
int n,AH,AM,AS,BH,BM,BS;
cin>>n;
while(n--){
cin>>AH>>AM>>AS>>BH>>BM>>BS;
int CH=0,CM=0,CS;
CS=AS+BS;
if(CS>=60){
CS-=60;
CM++;
}
CM+=AM+BM;
if(CM>=60){
CM-=60;
CH++;
}
CH+=AH+BH;
cout<<CH<<" "<<CM<<" "<<CS<<endl;
}
return 0;
}