标签:style blog color io ar 2014 div sp cti
/******************************************************************** @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; }
标签:style blog color io ar 2014 div sp cti
原文地址:http://www.cnblogs.com/roronoa-zoro-zrh/p/3967075.html