To obtain a C language program running time, commonly used method is to call time.h header file, which provides a clock () function can be invoked when the capture time it takes to start running the program from a clock (). This time unit is clock tick, or "dot clock." At the same time there is a constant CLK_TCK, given clock hit points per second machine clock go. So in order to obtain a function f of the running time, as long as we call before the first call to clock f (), to obtain a clock hit points C1; in calling clock after the completion of the implementation of f (), get another clock hit points C2; twice points of difference beat clock obtained (C2-C1) is f clock running consumed hit points, for CLK_TCK then divided by a constant, to get a running time in units of seconds.
Here it might simply assumed constant CLK_TCK 100. Now hit points to the clock function measured before and after the two-time given, please give you time to run the test function.
Input formats:
Input gives two integers C1 and C2 sequence in a row. Note that the obtained two clock certainly not hit the same point, i.e., a C1 <C2, and the value of [.
Output formats:
Measured output time function to run in a row. Run time must follow hh:mm:ss
(i.e., 2-bit 时:分:秒
output format); less than one second to the second rounded.
Sample input:
123 4577973
Sample output:
12:42:59
#include <stdio.h> int main () { int A; Scanf ( " % D " , & A ); int B; Scanf ( " % D " , & B); A = B- A; B =% A 100 ; // B is determined as rounding a = a / 100 ; // a number of preliminary minutes IF (B> = 50 ) a ++; // rounding the printf ( " % 02d:% 02d:% 02d " , a / 3600 , % A 3600 / 60 ,a%3600%60); return 0; }