A+B Problem
题目描述
输入两个整数 a,ba, ba,b,输出它们的和(∣a∣,∣b∣≤109|a|,|b| \le {10}^9∣a∣,∣b∣≤109)。
C
#include <stdio.h>
int main()
{
int a,b;
scanf("%d%d",&a,&b);
printf("%d\n", a+b);
return 0;
}
C++
#include <iostream>
#include <cstdio>
using namespace std;
int main()
{
int a,b;
cin >> a >> b;
cout << a+b << endl;
return 0;
}
Python3
s = input().split()
print(int(s[0]) + int(s[1]))
该问题要求求解两个整数a和b的绝对值不超过10^9的和。提供的代码示例分别使用C、C++和Python3语言实现,通过输入读取a和b的值并直接输出它们的和。





