PAT乙题 1026. 程序运行时间(15)

2018/01/26 PAT 共 332 字,约 1 分钟
//cpp:
#include <iostream>
#include <algorithm>
#include<math.h>
using namespace std;
int main() {
#ifdef LOCAL
		freopen("D:\\datain.txt", "r", stdin);
#endif LOCAL
	int a, b;
	cin >> a >> b;
	float c = (float)(b - a) / 100.0 + 0.5;
	int c1 = floor(c);
	int h = c1 / 3600;
	int m = (c1 - h * 3600) / 60;
	int s = c1 % 60;
	printf("%02d:%02d:%02d", h, m, s);
	return 0;
}

Search

    Table of Contents