This problem will not count towards your final score.
You are given a thousand pairs of integers
There are
Each set of inputs contains
- The first line is the integer
. The second line is the integer .
Since grhkm
is feeling nice today, here is a solution written in Python
:
# Iterate 1000 times
for _ in range(1000):
# Read the input
a = int(input())
b = int(input())
# Output the answer
print(a + b)
To run this on your machine, type python3 q0.py < 1.in > 1.out
. Replace
q0.py
with your file name, 1.in
and 1.out
with the correct input and
output files.
Here is the solution code in C++
:
#include <iostream>
int main() {
long a, b;
for (long T = 1; T <= 1000; T++) {
std::cin >> a >> b;
std::cout << a + b << std::endl;
}
}
To run this on your machine, type g++ q0.cpp -Wall -o q0 && ./q0 < 1.in > 1.out
. Replace q0.cpp
with your file name, 1.in
and 1.out
with the
correct input and output files.