풀이
C
while문으로 입력이 끝날 때까지 입력값의 합을 출력합니다.
C++
while문으로 입력이 끝날 때까지 입력값의 합을 출력합니다.
Java
while문으로 입력이 끝날 때까지 입력값의 합을 출력합니다.
Python
입력값의 합을 출력하며, EOFError로 입력이 끝나면 출력을 마칩니다.
코드
C
#include <stdio.h>
int main(){
    int a, b;
    while(scanf("%d %d", &a, &b) != EOF){
        printf("%d\n", a+b);
    }
    return 0;
}
C++
#include <iostream>
using namespace std;
int main() {
    int a, b;
    while (cin>>a>>b) {
        cout<<a+b<<endl;
    }
}
Java
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        
        while(sc.hasNextInt()) {
            int a = sc.nextInt();
            int b = sc.nextInt();
            System.out.println(a+b);
        }
    }
}
Python
while True:
    try:
        a,b=map(int,input().split(' '))
        print(a+b)
    except EOFError:
        break