백준 알고리즘 14918번 : 더하기

Zoo Da·2021년 7월 16일
0

백준 알고리즘

목록 보기
114/337
post-thumbnail

링크

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

문제

두 개의 정수 입력 a, b를 받아서 a+b를 출력하시오.

  • C 입출력 예제
#include <stdio.h>scanf(%d%d”, &a, &b);
printf(%d\n”, a+b);
  • C++ 입출력 예제
#include <iostream>
…
cin >> a >> b;
cout << a+b << endl;
  • JAVA 입출력 예제
import java.util.Scanner;
Scanner sc = new Scanner(System.in);
a = sc.nextInt();
b = sc.nextInt();
System.out.println((a+b));

입력

a b; a와 b는 -100,000과 100,000 사이의 정수이다.

출력

a+b

예제 입력 및 출력

풀이 코드(C++)

#include <iostream>
#include <deque>
#include <vector>
#include <queue>
#include <string>
#include <algorithm> 
#define fastio ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define max 1001
#define INF 1e9
using namespace std;

int main(){
  int a,b;
  cin >> a >> b;
  cout << a+b << endl;
  return 0;
}
profile
메모장 겸 블로그

0개의 댓글