자바/백준 알고리즘(자바)

[백준/자바] 10951번: A+B - 4

Heeyeon Choi 2021. 11. 2. 13:01
728x90

* EOF를 이용하여 Scanner 처리하기

import java.util.Scanner;
 
public class Main {
	public static void main(String args[]){
		
		Scanner in=new Scanner(System.in);
			
		while(in.hasNextInt()){
		
			int a=in.nextInt();
			int b=in.nextInt();
			System.out.println(a+b);
		
		}	
		in.close();
	}
}
728x90

 

728x90