注意对位,一把就过
头文件里没有cstdio也可以用c的输入输出哦~
#include <iostream>
using namespace std;
int main() {
int t;
scanf("%d",&t);
int str[6];
while(t--){
for(int i=0;i<6;i++)scanf("%d",&str[i]);
if(str[2]+str[5]>59){
str[2]=str[2]+str[5]-60;
if(str[1]>58){
str[1]=0;
str[0]++;
}
else{
str[1]++;
}
}
else
str[2]=str[2]+str[5];
if(str[1]+str[4]>59){
str[1]=str[1]+str[4]-60;
str[0]++;
}
else {
str[1]+=str[4];
}
printf("%d %d %d\n",str[0]+str[3],str[1],str[2]);
}
return 0;
}