洛谷 P1001 A+B Problem 题解

输入两个数,输出它们的和。

题目中,保证了 |a|和|b|都小于109,所以直接用int类型即可。

详见以下代码:

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

猜你喜欢

转载自www.cnblogs.com/SuperTer/p/luogu-P1001.html