Read two integer variables, calculate their sum, and print it.
Input
The input will contain two integers $A$
and $B$
($-20000000 < A, B < 20000000$
).
Output
Print the sum of the two integers.
Sample
Input | Output |
4 5 | 9 |
Solution
Python:
x=input()
a,b=x.split()
sum=(int(a)+int(b))
print(sum)
C++
#include<bits/stdc++.h>
using namespace std;
int main()
{
int a,b,c;
scanf("%d %d",&a,&b);
c=a+b;
printf("%d\n",c);
return 0;
}
C
#include<stdio.h>
int main ()
{
int a,b,sum;
scanf("%d",&a);
scanf("%d",&b);
sum=a+b;
printf("%d",sum);
return 0;
}
You must belogged in to post a comment.