Advertisement
SStoyanov22

Untitled

Sep 20th, 2014
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3.  
  4. public class _01_VideoDurations {
  5.  
  6. public static void main(String[] args) {
  7. Scanner sc = new Scanner(System.in);
  8. String input = "";
  9. int hours =0;
  10. int minutes = 0;
  11. while (!input.equals("End")) {
  12. input = sc.next();
  13. String[] duration = input.split(":");
  14. int h = Integer.parseInt(duration[0]);
  15. int m = Integer.parseInt(duration[1]);
  16. hours += h + m/60;
  17. minutes += m%60;
  18.  
  19. }
  20. System.out.println(""+hours+":"+minutes);
  21. }
  22.  
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement