-->
当前位置:首页 > 题库

PROGRAMMING:Minutes minus seconds

Luz5年前 (2021-05-10)题库416
Title Description:
Define a time class with minutes and seconds as its two private member data. Enter a start time and an end time (the start time is earlier than the end time), and calculate the number of seconds between the two times through operator overload - (minus sign). Note: the two times are within the same hour, and the 60 minute and 60 second timing fraction is used, that is, from 00:00 to 59:59.
Input format: the test input contains several test cases, and each test case occupies one line. Each test case consists of four numbers, which are separated by spaces. Each number is composed of two digits. The first number and the second number represent minutes and seconds of the start time respectively, and the third number and the fourth number represent minutes and seconds of the end time respectively. When a test case read in is 00, the input ends, and the corresponding result is not output.
Output format: output one line for each test case. Output a number, indicating the number of seconds between the two.
Input example:
   12 11 12 58
   00 13 16 00
   09 07 23 59
   00 00 00 00
Output example:
   47
   947
   892






answer:If there is no answer, please comment