题目描述
解题思路
h = [t / 3600]
m = [t / 60] mod 60
s = t mod 60
用round函数实现四舍五入
c++程序实现
#include <bits/stdc++.h>
using namespace std;
using gg = long long;
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
gg c1, c2;
cin >> c1 >> c2;
c1 = round((c2 - c1) / 100.0); //节约空间,编程时要常有这种意识
cout << setfill('0') << setw(2) << c1 / 3600 << ":" << setw(2) << c1 / 60 % 60 << ":" << setw(2) << c1 % 60;
return 0;
}