[백준] 2530번 : 인공지능 시계 - Java(자바)

강재원·2022년 9월 14일
0

[코딩테스트] Java

목록 보기
34/200



https://www.acmicpc.net/problem/2530

import java.util.*;
public class Main {
    public static void main(String args[]) {
        Scanner sc=new Scanner(System.in);
        int h=sc.nextInt();
        int m=sc.nextInt();
        int s=sc.nextInt();
        int n=sc.nextInt();
        int sum=s+n;
        m+=sum/60;
        sum%=60;
        h+=m/60;
        m%=60;
        h%=24;
        System.out.format("%d %d %d",h,m,sum);
    }
}
profile
개념정리 & 문법 정리 & 알고리즘 공부

0개의 댓글