Home H990. 근무 시간
Post
Cancel

H990. 근무 시간

문제

image


제출 코드

image


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import java.util.*;
import java.io.*;

public class Main
{
    public static int changeToNum(String str){
        String[] spt = str.split(":");
        return Integer.parseInt(spt[0])*60 + Integer.parseInt(spt[1]);
    }

    public static void main(String args[]) throws IOException
    {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int result = 0;
        for(int i=0; i<5; i++){
            String[] str = br.readLine().split(" ");
            result += changeToNum(str[1]) - changeToNum(str[0]);
        }
        System.out.println(result);
    }
}
This post is licensed under CC BY 4.0 by the author.