2020牛客暑期多校训练营(第二场)

D.Duration

题目链接

代码:

#include<bits/stdc++.h>
using namespace std;
const int maxn =  1e5 + 10;



signed main()
{
    int h1 , h2 , m1 , m2 , s1 , s2;
    scanf("%d:%d:%d" , &h1 , &m1 , &s1);
    scanf("%d:%d:%d" , &h2 , &m2 , &s2);
    int h , m , s;
    h = h1 - h2 , m = m1 - m2 , s = s1 - s2;
    cout << abs(s + 60 * m + 60 * 60 *h) << '
';
    return 0;
}
View Code
原文地址:https://www.cnblogs.com/GoodVv/p/13364045.html