#10951
import java.io.*;
import java.util.*;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int a,b;
String line;
while((line=br.readLine())!=null) {
StringTokenizer st = new StringTokenizer(line);
a = Integer.parseInt(st.nextToken());
b = Integer.parseInt(st.nextToken());
System.out.println(a+b);
}
}
}
#10952
import java.io.*;
import java.util.*;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
int a,b;
StringTokenizer st = new StringTokenizer(br.readLine());
a = Integer.parseInt(st.nextToken());
b = Integer.parseInt(st.nextToken());
System.out.println(a+b);
while ((a+b)!=0){
st = new StringTokenizer(br.readLine());
a = Integer.parseInt(st.nextToken());
b = Integer.parseInt(st.nextToken());
if ((a+b)!=0){
System.out.println(a+b);
}
}
bw.flush();
bw.close();
}
}
위 를 좀더 정리...
import java.io.*;
import java.util.*;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
int a,b;
while(true) {
StringTokenizer st = new StringTokenizer(br.readLine());
a = Integer.parseInt(st.nextToken());
b = Integer.parseInt(st.nextToken());
if ((a+b)==0){
break;
}
System.out.println(a+b);
}
bw.flush();
bw.close();
}
}