제목 1000: a+b 계산

2827 단어 계산하다
제목 설명:
정수 a, b의 합을 구하다.
입력:
테스트 사례가 여러 줄로 되어 있고 매 행위 a, b의 값이 있습니다.
출력:
a+b에 대응하는 여러 줄을 출력합니다.
샘플 입력:
1 2

4 5

6 9

샘플 출력:
3

9

15

java Code

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();

            int c = a + b;

            System.out.println(c);

        }

    }

}

 

/**************************************************************

    Problem: 1000

    User: Mokaffe

    Language: Java

    Result: Accepted

    Time:80 ms

    Memory:15468 kb

****************************************************************/

C Code
#include <stdio.h>

int main() {

    int a,b;

    while (scanf("%d %d",&a, &b) != EOF) {

        printf("%d
",a+b); } return 0; } /************************************************************** Problem: 1000 User: Mokaffe Language: C Result: Accepted Time:0 ms Memory:912 kb ****************************************************************/

좋은 웹페이지 즐겨찾기