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; }