Skip to content

Commit 875ca64

Browse files
authored
Merge pull request ashutosh97#97 from chippyho123/master
Added Problem
2 parents ad7f007 + 73165f0 commit 875ca64

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

The Additionator/The Additionator.txt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
The Additionator -
2+
3+
The first line contains an integer 1≤N≤100000 (The number of addition problems). The next N lines will each contain two space-separated integers whose absolute value is less than 1000000000 (numbers to add)
4+
5+
Output N lines of one integer each, the solutions to the addition problems in order.
6+
7+
Example:
8+
9+
IN
10+
11+
3
12+
4 2
13+
-1 -1000
14+
9 10
15+
16+
OUT
17+
18+
6
19+
-1001
20+
19

The Additionator/solution.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import java.util.*;
2+
3+
public class Main {
4+
public static void main(String[] args) {
5+
Scanner in = new Scanner(System.in);
6+
7+
int N = in.nextInt();
8+
for (int i = 0; i < N; i++) {
9+
int a = in.nextInt();
10+
int b = in.nextInt();
11+
System.out.println(a + b);
12+
}
13+
}
14+
}

0 commit comments

Comments
 (0)