백준공부/java

[백준] 10952번 A+B -5 문제! (bronze 5

gomduri43 2022. 7. 10. 17:54

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner input=new Scanner(System.in);
		outerLoop:
		while(true) {
			int a=input.nextInt();
			int b=input.nextInt();
			
			if(a+b==0) {
				break outerLoop;
			}
			
			System.out.println(a+b);
		}
	}

}
//while문에서 0 0 입력시 while 문을 탈출
//굳이 outerLoop를 사용하지 않아도 탈출 가능