백준 5554 java

magicdrill·2024년 9월 11일

백준 문제풀이

목록 보기
436/673

백준 5554 java

import java.util.Scanner;

public class bj5554 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int homeToSchool;
        int schoolToPc;
        int pcToAfterSchool;
        int afterSchoolToHome;
        int totalSec;
        int x, y;

        homeToSchool = scanner.nextInt();
        schoolToPc = scanner.nextInt();
        pcToAfterSchool = scanner.nextInt();
        afterSchoolToHome = scanner.nextInt();
        totalSec = homeToSchool + schoolToPc + pcToAfterSchool + afterSchoolToHome;
        x = totalSec / 60;
        y = totalSec % 60;
        System.out.println(x);
        System.out.println(y);

        scanner.close();
    }
}

0개의 댓글