< 목차 >


6/5 OT 진행


6/7 백준 1000, 2558 - 발표자 : 지수

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

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

1. 주로 쓰이는 Scanner 클래스의 메서드를 알아보기 위한 예제 준비

public static void main( String[] args ) {
        Scanner sc = new Scanner( System.in );
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int d = sc.nextInt();
        String e = sc.nextLine();
        String f = sc.nextLine();
        String g = sc.nextLine();
        String h = sc.next();
        String i = sc.next();
        String j = sc.next();
        System.out.println( "a : " + a + ", b : " + b );
        System.out.println( "c : " + c + ", d : " + d );
        System.out.println( "e : " + e + ", f : " + f );
        System.out.println( "g : " + g + ", h : " + h );
        System.out.println( "i : " + i + ", j : " + j );
}

입력값

/* 입력
1 2
3 4
You look so sad.
No, I am not sad.
OK, I got it

출력
a : 1, b : 2
c : 3, d : 4
e : , f : You look so sad.
g : No, I am not sad., h : Ok,
i : I, j : got
*/