Educatifu
Open menu

Add Two Numbers

Warmupmathio

Read two integers and print their sum. This is a warm-up to get familiar with reading from standard input and writing to standard output.

Input

A single line with two integers a and b, separated by a space.

Output

A single integer: a + b.

Examples

Example 1

Input
3 5
Output
8

3 + 5 = 8.

Example 2

Input
-2 7
Output
5

Negative numbers work too: -2 + 7 = 5.

Example 3

Input
40 2
Output
42

Constraints

  • -10^9 <= a, b <= 10^9

Hints

Reveal hint 1

Read the whole line, split it on the space, and convert both parts to integers.

Reveal hint 2

In Python: `a, b = map(int, input().split())`.

Reference solution (spoiler — try it yourself first)

Approach

Parse the two integers from the single input line and print their sum.

a, b = map(int, input().split())
print(a + b)

← All practice problems

Bring us the problem, not a perfect specification

Tell us what needs to change, who it affects and any important deadline. We will review the context and reply with useful next questions.

  1. 01Share contextDescribe the workflow, constraint or risk.
  2. 02Clarify togetherWe identify missing facts and useful options.
  3. 03Choose a startAgree a focused assessment or delivery step.
Start a conversation