[백준] 2558번 A+B – 2 풀이 코드 (C/C++/Java 자바/Python 파이썬)

by iamtrueline

풀이

입력값의 합을 출력합니다.


코드

C

#include <stdio.h>

int main(){
    int a, b;
    scanf("%d %d", &a, &b);
    printf("%d", a+b);
    return 0;
}

C++

#include <iostream>

int main(){
    int a, b;
    std::cin>>a>>b;
    std::cout<<a+b;
    return 0;
}

Java

import java.util.Scanner;
class Main{  
    public static void main(String[] args){      
        Scanner sc = new Scanner(System.in);     
        System.out.print(sc.nextInt() + sc.nextInt());   
    }  
}

Python

a = int(input())
b = int(input())
print(a+b)

문제 출처

https://www.acmicpc.net/problem/2558

You may also like

Leave a Comment

Are you sure want to unlock this post?
Unlock left : 0
Are you sure want to cancel subscription?
-
00:00
00:00
Update Required Flash plugin
-
00:00
00:00