2033 人见人爱a+b.cpp

来自「威士忌的HDU题解.大概有260多题的源码。对于学习非常有好处。」· C++ 代码 · 共 37 行

CPP
37
字号
/*
2033 人见人爱A+B
Time Limit : 1000 ms  Memory Limit : 32768 K  Output Limit : 256 K

GUN C++
*/
#include <iostream>
using namespace std;

const int Max=1000;

int main()
{
    int t,i;
    int ah,am,as,bh,bm,bs;
    int h,m,s;
    
    cin>>t;
    while(t--)
    {
        cin>>ah>>am>>as>>bh>>bm>>bs;
        h=m=s=0;
        
        s=as+bs;
        if(s>=60)
        {   m=1;s%=60;}
        m+=am+bm;
        if(m>=60)
        {   h=1;m%=60;}
        h+=ah+bh;
        
        cout<<h<<' '<<m<<' '<<s<<endl;
    }
    return 0;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?