解题思路:
注意事项:
参考代码:
#include<iostream>
#include<cstring>
using namespace std;
int main()
{
int T;
cin >> T;
while (T--)
{
char s[100];
int arr[7] = { 0 };
for (int i = 1; i <= 6; i++)
{
cin >> s;
getchar();//将空格给消掉
arr[i] = atoi(s);//将数字字符串转化为数字
}
int s1 = arr[1]+arr[4];
int s2 = arr[2]+arr[5];
int s3 = arr[3]+arr[6];
if (s3 >= 60)
{
s2 += s3/60;
s3 %=60;
}
if (s2 >= 60)
{
s1 += s2/60;
s2 %=60;
}
cout << s1 << " " << s2 << " " << s3 << endl;
}
return 0;
}
0.0分
0 人评分