Last active
January 18, 2018 08:01
-
-
Save keehyun2/a74998a034c2491da39ca39af56a6e5f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.BufferedReader; | |
import java.io.IOException; | |
import java.io.InputStreamReader; | |
import java.util.StringTokenizer; | |
public class Main { | |
public static void main(String args[]) throws IOException { | |
// readline 을 사용하려면 예외처리가 필요하다. | |
// BufferedReader가 Scanner 보다 입력 받는게 빠르다. ms 단위에서... | |
// 알고리즘 문제에서 실행시간 줄이기 위해 많이 쓰는 방법이다. | |
BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); | |
StringTokenizer st = new StringTokenizer(br.readLine().trim()); | |
System.out.println(Integer.parseInt(st.nextToken()) + Integer.parseInt(st.nextToken())); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment