(구) solved ac class 문제들/class 1

[class 1]백준 A-B(1001번) 풀이 (C++/Python)

isekaipudding 2026. 1. 28. 23:45

문제 : A-B(1001번)(Bronze V)

문제 링크 : https://www.acmicpc.net/problem/1001
출처 : Baekjoon Online Judge

 

A+B 문제에서 A-B로 바꾸면 끝납니다.

 

[C++]

#include <bits/stdc++.h>

using namespace std;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int a, b;
    cin >> a >> b;
    cout << a - b;

    return 0;
}

[Python]

import sys

input = sys.stdin.readline

A, B = map(int, input().split())

print(A - B)