Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Text.RegularExpressions;
- class UserLogs
- {
- static void Main()
- {
- int totalMinutes = 0;
- string input = Console.ReadLine();
- while (input != "End")
- {
- int[] arr = input.Split(':').Select(int.Parse).ToArray();
- int mins = arr[1];
- int hours = arr[0];
- totalMinutes += hours * 60 + mins;
- input = Console.ReadLine();
- }
- int totalHours = totalMinutes / 60;
- totalMinutes %= 60;
- Console.WriteLine("{0}:{1}", totalHours, totalMinutes.ToString("D2"));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement