728x90

알고리즘 문제풀기 시작.

그냥 그렇다고하는거 시간을 재면서 써보니까 좋네^^




1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
 
public class Backjoon1000_DrEngineer
{
    public static void main(String[] args) throws IOException
    {
        //메모리 13024KB 시간:92ms
        BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));
        String inputValue;
        String[] numbers = new String[2];
        while ((inputValue = bufferedReader.readLine()) != null)
        {
            numbers = inputValue.split(" ");
 
            System.out.print(Integer.valueOf(numbers[0]) + Integer.valueOf(numbers[1]));
        }
 
        /*        // 메모리 14408   112
        Scanner scanner = new Scanner(System.in);
        int A = scanner.nextInt();
        int B = scanner.nextInt();
        if (!(0 >= A || B >= 10))
            System.out.print(A + B);
        scanner.close();*/
        /*        // 메모리 14440 시간  112
        Scanner scanner = new Scanner(System.in);
        int A = scanner.nextInt();
        int B = scanner.nextInt();
        if (0 < A && B < 10)
            System.out.print(A + B);
        scanner.close();*/
    }
}



cs




+ Recent posts