2020-02-03
作者:互联网
杭电2033:人见人爱A+B
挺简单的,把所有情况列举出来
G++ AC代码如下
#include<bits/stdc++.h>
using namespace std;
int main ()
{
int N,AH,AM,AS,BH,BM,BS,H,M,S;
cin>>N;
while(N–)
{
cin>>AH>>AM>>AS>>BH>>BM>>BS;
H=AH+BH;
M=AM+BM;
S=AS+BS;
if(S>59)
{ S=S-60;
M=M+1;
if(M>59)
{
M=M-60;
H=H+1;
}
}
else
{
if(M>59)
{
M=M-60;
H=H+1;
}
}
printf("%d %d %d\n",H,M,S);
}
return 0;
}
希望对大家有所帮助!
标签:02,03,BM,AM,BH,60,AH,2020,BS 来源: https://blog.csdn.net/weixin_45802966/article/details/104152790