Programming contests

50 Programming Exercise for Beginners

January 2, 2019 12:00 AM – December 31, 2019 12:00 AM

Working Hours

Write a program that helps you calculate the employees’ time spent on work.

The input contains several test cases. Each line of a test case gives the length of a time period spent on work in H.MM format, where H denotes the number of hours (H ≥ 0), and MM denotes the minutes, the latter always given with two digits (0 ≤ HH < 60).

Test cases are terminated by a line containing the string „END”. You may assume that all employees spend at least a short time on work.

The program should write to the standard output the total time spent on work by each employee, in the same format as in the input.

Sample Input

  1. 3.20
  2. 4.30
  3. 5.00
  4. END
  5. 10.00
  6. END
download as text file

Output for Sample Input

  1. 12.50
  2. 10.00
download as text file

Possible solutions: main1.c and main2.c.

Acknowledgement This work was supported by the construction EFOP-3.4.3-16-2016-00021. The project was supported by the European Union, co-financed by the European Social Fund.
University of Debrecen; Faculty of Informatics; v. 03/01/2019