## A Plus B

Given two integers a and b, output the sum of a and b.
A and B, as well as A+B will be less than 10000 in absolute value.

Point Value: 2
Time Limit: 2.00s
Memory Limit: 16M

Problem Types: [Show]

Languages Allowed:
C++03, PAS, C, HASK, ASM, RUBY, PYTH2, JAVA, PHP, SCM, CAML, PERL, C#, C++11, PYTH3

<
1
2
>

• (4/0)
C++
``     #include<iostream>        using namespace std;          int main(){           int a,b;             cin>>a;             cin>>b;           int c = a+b;        cout<<c<<endl;        return 0;       } ``

Java
``     import java.util.Scanner;       public class aplusb{         public static void main(String[]args){           Scanner sc = new Scanner(System.in);           int a = sc.nextInt();           int b = sc.nextInt();           int c = a+b;           System.out.println(c);             }   } ``

Pascal
``   var a,b:integer;     begin      readln(a);      readln(b);      writeln(a+b);   end. ``

Python2
``    num1 = int(raw_input())    num2 = int(raw_input())    sum = num1+num2;    print sum ``

Python3
`` a = int(input()) b = int(input()) print (a+b) ``

``   main = getLine >>=\numStr1 ->     getLine >>=\numStr2 ->     putStrLn \$ show \$(read numStr1 :: Int) + (read numStr2 :: Int) ``

C
``     main(){      int a,b;     scanf("%d %d",&a,&b);     printf("%d\n",a+b);     return 0;     } ``

PERL
`` #!/usr/bin/perl @data = split(' ',<STDIN>); if(\$#data<=0) {    \$a = int \$data;    \$b = int <STDIN>; } else {    \$a = int \$data;    \$b = int \$data; } \$a+=\$b; print("\$a\n"); ``

Ruby
`` val1 = gets; val2 = gets; print  (val1.to_i + val2.to_i), "\n"; ``

• (3/3)
Why do some people have more than 2 points for this problem?

• (2/3)
where do you see this?

• (8/3)
people who are cleaning up problem statements get their points added to a plus b

• (0/1)
Wow. That's a bit cool.

• (6/57)
Can we please have more questions like these.

We can do:
a*b
a**b
a-b
a/b
a%b
.....

• (42/7)
Then let's all go write the Beaver contest

• (24/6)
Adding problems like these will not help you to improve; this problem exists primarily as a way to ensure you know how submitting code to the judge works.

If you want some easy problems to look at, you are welcome to try solving the Bluebook problems.

• (0/3)
These problems are WAY too easy.

• (11/2)

• (0/3)
Really? Mind, I solved it first try.

No offence meant.

• (1/3)
yay

• (0/1)
Some submissions have memory usage below the minimum assembly program(sys_exit();), this shouldn't be possible. Also, can we please rejudge this problem? As it currently stands it's literally impossible to compete with the earlier submissions for memory usage.

• (1/1)
These are relics of a time where runtime and memory usage could not be measured as accurately, though this generally only occurred when the program ran for very short periods of time.

Very frankly, there's little purpose in competing for memory usage on problems like these, where there's almost zero room for memory optimisation. It is my personal opinion (and not necessarily the position of the Judge in general) that it would be a waste of resources to rejudge these submissions.

• (0/2)
For this problem, everyone can easily get 0.000s, the only thing that is actually "competable" is the memory usage. This problem can also encourage participants to learn assembly.

• (3/1)
Go solve aplusb2 in assembly if you care. That's a real challenge. Don't waste your time with this problem.

• (1/3)
Somehow got 100/100 and an RE

• (2/3)
If you return a nonzero value, then your code will RE. As long as you produce the correct output, however, you'll still earn the points.

• (0/4)
I fanally can chat. Why does peg make you do this question in order to chat? its werid.

• (2/3)
There have been issues in the past with spambots, as there isn't really any registration verification. Since anybody who can program should be able to solve A plus B, this acts as a sort of filter, that determines the users from the spambots

• (2/2)
Anybody who can write a spam bot can also solve this...(and I really doubt there are any "creative" solutions to this)

• (7/2)
This is a measure against automated bots that cast a wide net.

If somebody were to write a bot that specifically targeted us, then naturally this wouldn't work.

Mind you, this isn't an invitation to try and do just that...

• (4/3)
This isn't even supposed to be a chat. It should really only be used for discussing whether the problem might have an issue, such as incorrect test data or an overly strict time limit.

• (7/2)
We're going to make it so you'll have commenting privileges as soon as you score any points. The only reason it isn't yet is performance issues (read: implementer laziness).

• (0/2)
run again

• (2/11)
bruce why am i getting TLE?