목차

  1. 환경
  2. 문제
  3. 접근법
  4. Library
  5. Code
  6. 정리
  7. Link

1. 환경

Editor: Microsoft Visual Studio Code
Compiler: C++20

2. 문제

Link1 BOJ1000

3. 접근법

알고리즘 분류

  • 수학
  • 구현
  • 사칙연산

단순하게 A+B를 출력하는 문제 그대로 구현해준다.

4. Library

bits/stdc++.h - Link2
(GNU C++ Standard Library Header - X)
(GCC Compiler Header - O)

5. Code

#include <bits/stdc++.h>

using namespace std;

int A, B, res;

void input();
void func();
void output();

int main(void)
{
    input();
    func();
    output();
}

void input()
{
    cin >> A >> B;
}

void func()
{
    res = A + B;
}

void output()
{
    cout << res << '\n';
}

6. 정리

문제 제한 조건이 단순하여 그대로 구현하면 되는 문제였다.
단 제한 조건이 까다로워질 경우 int타입이 아닌 long타입 혹은 charstring을 고려하자.

1. BOJ1000 - A+B
https://www.acmicpc.net/problem/1000
2. bits/stdc++.h
https://gcc.gnu.org/onlinedocs/gcc-4.8.0/libstdc++/api/a01541_source.html
3. Cplusplus.com
https://www.cplusplus.com/reference/