公式

A - Wrong Answer 解説 by en_translator


For beginners

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';
}

投稿日時:
最終更新: