Algorithm/Java

[백준/자바] 11022번 - Java

isshosng 2022. 1. 25. 21:16
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import java.util.Scanner;
public class Main{
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a,b,c;
        for(int i=1; i<=n; i++){
            a = sc.nextInt();
            b = sc.nextInt();
            c = a+b;
            System.out.println("Case #"+i+": "+a+" + "+b+" = "+c);
        }
        sc.close();
    }
}
cs

 

객체 이름을 주로 쓰던 in에서 sc로 바꾸어보았다.

반응형