Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Marketing {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- Scanner console = new Scanner(System.in);
- Integer seconds1 = Integer.parseInt(console.nextLine());
- Integer seconds2 = Integer.parseInt(console.nextLine());
- Integer seconds3 = Integer.parseInt(console.nextLine());
- Integer seconds = seconds1 + seconds2 + seconds3;
- Integer minutes = 0;
- if (seconds>119) {
- minutes+=2;
- seconds = seconds - 120;
- }else if (seconds>59){
- minutes++;
- seconds = seconds-60;
- }if (seconds<10){
- System.out.println(minutes + ":" + "0" + seconds);
- } else {
- System.out.println(minutes + ":" + seconds);
- }
- //code ends here
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement