๋ฐ์ํ
https://www.acmicpc.net/problem/13985
๋ฌธ์
You are grading an arithmetic quiz. The quiz asks a student for the sum of the numbers. Determine if the student taking the quiz got the question correct.
์ ๋ ฅ
The first and the only line of input contains a string of the form:
a + b = c
It is guaranteed that a, b, and c are single-digit positive integers. The input line will have exactly 9 characters, formatted exactly as shown, with a single space separating each number and arithmetic operator.
์ถ๋ ฅ
Print, on a single line, YES if the sum is correct; otherwise, print NO.
ํ์ด
// Authored by : seondal
// Co-authored by : -
// #include <bits/stdc++.h>
#include <iostream>
#include <vector>
using namespace std;
int main() {
ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
int a, b, c;
char oper, eq;
cin >> a >> oper >> b >> eq >> c;
if(a+b == c)
cout << "YES";
else
cout << "NO";
return 0;
}
/*
*/
๋ฐ์ํ
'๐ฆ Chango > ๐ซ First Solve at School' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[BOJ B2][C++] ๋ฐฑ์ค 1731๋ฒ: ์ถ๋ก (0) | 2023.01.05 |
---|---|
[BOJ B3][C++] ๋ฐฑ์ค 10419๋ฒ: ์ง๊ฐ (0) | 2023.01.02 |
[BOJ S4][C++] ๋ฐฑ์ค 14495๋ฒ: ํผ๋ณด๋์น ๋น์ค๋ฌด๋ฆฌํ ์์ด (0) | 2022.12.29 |
[BOJ B3][C++] ๋ฐฑ์ค 14920๋ฒ: 3n+1 ์์ด (0) | 2022.12.28 |
[BOJ B2][C++] ๋ฐฑ์ค 2153๋ฒ: ์์ ๋จ์ด (0) | 2022.12.13 |