dong3512   1년 전

<pre>import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {
    public static void main(String[] args) throws Exception {

        BufferedReader br = new BufferedReader(new InputStreamReader(System.<i>in</i>));

        StringTokenizer st = new StringTokenizer(br.readLine());
        int h = Integer.<i>parseInt</i>(st.nextToken());
        int m = Integer.<i>parseInt</i>(st.nextToken());
        int t = Integer.<i>parseInt</i>(br.readLine());

        if( 0 <= h && h <= 23 && 0 <= m && m <= 59 && 0 <= t && t <= 1000) {
            int totalM = m + t;     // 총합타이머
            int tH = totalM / 60;   // 추가해야할 시간
            int tM = totalM % 60;   // 나타낼 분

            System.<i>out</i>.println("totalM : " + totalM);
            System.<i>out</i>.println("tH : " + tH);
            System.<i>out</i>.println("tM : " + tM);

            int resultT = (h + tH) % 24;

            System.<i>out</i>.println(resultT +" " + tM);
        }
    }
}</pre>


왜 틀린걸까요 ..

돌리면 값은 맞습니다 .

백준에서 틀리다고 나옵니다 . 

sam020329   1년 전

html 태그하고 출력 디버깅 할 때 사용한 코드만 지우면 맞다고 나오는 것 같습니다.

dong3512   1년 전

감사합니다 ㅜㅜㅜ 로그를 깜박하고 안지웠군요

댓글을 작성하려면 로그인해야 합니다.