https://www.acmicpc.net/problem/10952
0 0 이 입력되기 전까지 무한히 반복함으로 while(true)로 반복하고 조건문으로 break한다.
import java.util.Scanner;
public class Main{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while(true){
int a = sc.nextInt();
int b = sc.nextInt();
if(a == 0 && b == 0) break;
else System.out.println(a + b);
}
sc.close();
}
}