- 一定要注意时间类的数据的格式化输出
#include <cstdio>
#include <cmath>
using namespace std;
int main() {
int c1, c2;
scanf("%d%d", &c1, &c2);
int d = round((0.0 + c2 - c1) / 100);
int h = d / 3600;
d %= 3600;
int m = d / 60, s = d % 60;
printf("%02d:%02d:%02d", h, m, s);
return 0;
}
网友评论