/******************************************************************** @file Main_practise.cpp @date 2014-9-11 @author Tiger @brief 人见人爱A+B ********************************************************************/ #include <cstdio> #include <cstring> #define MAX 60 struct sTime { sTime(void) : m_nHou(0), m_nMin(0), m_nSec(0) { } int m_nHou; int m_nMin; int m_nSec; }; int main(int argc, const char* argv[]) { int nTestCases = 0; scanf("%d", &nTestCases); while (nTestCases--) { sTime timeA, timeB; scanf("%d%d%d%d%d%d", &timeA.m_nHou, &timeA.m_nMin, &timeA.m_nSec, &timeB.m_nHou, &timeB.m_nMin, &timeB.m_nSec); timeA.m_nSec += timeB.m_nSec; if (timeA.m_nSec >= MAX) { timeA.m_nMin += timeA.m_nSec/MAX; timeA.m_nSec = timeA.m_nSec%MAX; } timeA.m_nMin += timeB.m_nMin; if (timeA.m_nMin >= MAX) { timeA.m_nHou += timeA.m_nMin/MAX; timeA.m_nMin = timeA.m_nMin%MAX; } timeA.m_nHou += timeB.m_nHou; printf("%d %d %d\n", timeA.m_nHou, timeA.m_nMin, timeA.m_nSec); } return 0; }
时间: 2024-10-12 01:00:49