公式
A - Wrong Answer 解説 by en_translator
For beginners
- If you are new to learning programming and do not know where to start, please try Problem A "Welcome to AtCoder" from practice contest. There you can find a sample code for each language.
- Also, if you are not familiar with problems in programming contests, we recommend you to try some problems in "AtCoder Beginners Selection".
- 「C++入門 AtCoder Programming Guide for beginners (APG4b)」 is a C++ tutorial for competitive programmers. Sadly, this is only in Japanese too.
This problem can be solved with many approaches. Especially, the answer is not unique in this problem, which allows a wider variety of solutions than many other problem A of AtCoder Beginner Contest. We introduce here one of the solutions.
Compute \(A + B\). If it is \(0\), print \(1\); otherwise, print \(0\).
Sample code
#include <bits/stdc++.h>
using namespace std;
int main() {
int a, b;
cin >> a >> b;
cout << (a + b == 0 ? 1 : 0) << '\n';
}
投稿日時:
最終更新: