其他分享
首页 > 其他分享> > 杭电2033 人见人爱A+B

杭电2033 人见人爱A+B

作者:互联网

C

#include <stdio.h>

int main()
{
   int n;
   scanf("%d", &n);
    while (n--) {
        int h1, m1, s1, h2, m2, s2;
        scanf("%d %d %d %d %d %d", &h1, &m1, &s1, &h2, &m2, &s2);
        int s;
        int m_ = 0;
        if ((s1 + s2) >= 60) s = (s1 + s2) % 60, m_ = 1;
        else s = s1 + s2;

        int m;
        int h_ = 0;
        if ((m1 + m2 + m_) >= 60) m = (m1 + m2 + m_) % 60, h_ = 1;
        else m = m1 + m2 + m_;

        int h;
        h = h1 + h2 + h_;

        printf("%d %d %d\n", h, m, s);

    }
    return 0;
}

标签:人见人爱,int,s2,s1,60,杭电,2033,m2,m1
来源: https://blog.csdn.net/Justodiante/article/details/113701365