package com.javarush.task.task01.task0133; /* Не думать о секундах… */ public class Solution { public static void main(String[] args) { int secondsAfter15; String oldTime = new String ("15:00"); String newTime = new String("15:30"); String oldHour = oldTime.substring(1,3); String oldMin = oldTime.substring(4); String newHour = newTime.substring(1,3); String newMin = newTime.substring(4); int oldH = Integer.parseInt(oldHour); int oldM = Integer.parseInt(oldMin); int newH = Integer.parseInt(newHour); int newM = Integer.parseInt(newMin); if (oldH == newH) { secondsAfter15 = (newM - oldM) * 60; System.out.println(secondsAfter15); } } }