题解:P1001 A+B Problem

· · 题解

思路

大家应该都会吧。

可是,我的键盘上的加好坏了,怎么办呢?

思考后,我发现了另一种方法。

a-(-b)=a+b

于是,我立刻写了篇题解。

代码

#include <bits/stdc++.h>
using namespace std;
int a, b;
int main()
{
    cin >> a >> b;
    cout << a - -b;
    return 0;
}