pat1026:程序运行时间

https://www.patest.cn/contests/pat-b-practise/1026

#include "stdio.h"

#define CLK 100

int main()
{
	int a, b, s, f, m, d;
	scanf("%d %d", &a, &b);
	d = (int)(1.0 * (b - a) / CLK + 0.5);
	s = d / 3600;
	f = (d % 3600) / 60;
	m = d % 60;
	printf("%02d:%02d:%02d\n", s, f, m);

	return 0;
}


你可能感兴趣的:(c,pat)