P1001 A+B Problem

Background

**If you’re new to programming contests, please read this carefully:** In programming contests, your program’s output **must contain only the answer—nothing extra**. That **includes messages like “Please enter integers a and b”** or any other prompts for the user. If you print anything like that, the system will mark your submission as **Wrong Answer** (shown as **WA** on Luogu). When checking your output, the judge system will ignore spaces at the end of any line and extra blank lines after the last line of output. But if your code prints extra text (like prompts or explanations), it will be marked wrong—even if the answer itself is correct. So, if your program works fine on your own computer but gets WA when you submit it, **don’t blame the judge system**. Instead, double-check that you’re not printing anything unnecessary. You can look at the sample code at the end of this problem for reference. Also, **try using the IDE mode** on Luogu—it helps avoid small differences between your local environment and the judge’s system. Finally, **don’t post your solution in the discussion section**. Solutions should go in the “Solution” area. If you post a full solution in the comments, it may be deleted, and you could even be muted. If you can’t submit a solution, it means too many people have already done so—but you still shouldn’t post it in the discussion. Only if your method is truly different from all existing ones should you contact a site admin to ask for permission to add your solution.

Description

Input two integers, $a$ and $b$, and output their sum ($|a|,|b| \le {10}^9$). ### Notes: 1. In Pascal, using `integer` may overflow. 2. Negative numbers are allowed. 3. In C/C++, the `main` function must return `int`, and you must `return 0`. This is a general requirement for problems on Luogu as well as in NOIP/CSP/NOI contests. Let's get started with this simple problem and begin the journey toward becoming an expert. > Every great idea has a humble beginning.

Input Format

Two space-separated integers.

Output Format

A single integer.

Explanation/Hint

### Program Examples in Various Languages: **C** ```c #include int main() { int a,b; scanf("%d%d",&a,&b); printf("%d\n", a+b); return 0; } ``` **C++** ```cpp #include #include using namespace std; int main() { int a,b; cin >> a >> b; cout a + b, 0) console.log(result) process.exit() // Ensure this line is added at the exit point ``` **Ruby** ```ruby a, b = gets.split.map(&:to_i) print a+b ``` **PHP** ```php