Addition
Time limit1sMemory limit512 MB
Read two integers between -100,000 and 100,000 and print their sum.
- Level
Easy1 of 10
- Topics
- Math, Implementation
- Solved
- No attempts yet
Problem
Read two integers and , then print .
Input and output in C
#include <stdio.h>
...
scanf("%d%d", &a, &b);
printf("%d\n", a + b);
Input and output in C++
#include <iostream>
...
cin >> a >> b;
cout << a + b << endl;
Input and output in Java
import java.util.Scanner;
...
Scanner sc = new Scanner(System.in);
a = sc.nextInt();
b = sc.nextInt();
System.out.println(a + b);
Input
The first line contains and , separated by one space. Both values are integers between -100,000 and 100,000.
Output
Print on the first line.