HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Forums > Discussion of problems > topic:


Problem "50540 - A+B"

There is a contest!

В настоящий момент идёт турнир. Некоторая информация и функции сервера недоступны до его окончания.

imesecanSep.20.2015 at 12:00:59 PM
0-- Test 1 ---
1
2

--- Pattern ---
3

imesecanOct.16.2015 at 08:26:07 AM
1--- Python solution ---
a = int(input())
b = int(input())

print(a+b)

imesecanOct.16.2015 at 08:26:40 AM
2--- C++ Solution ---
#include <iostream>
using namespace std;
int main()
{
int A, B;
cin>>A;
cin>>B;
cout<<A+B<<endl;
return 0;
}

imesecanOct.16.2015 at 08:27:00 AM
3--- Pascal Solution ---
uses SysUtils;
var
a, b: Integer;
begin
ReadLn(a,b);
WriteLn(a + b);
end.

imesecanOct.16.2015 at 08:27:50 AM
4---Error Logs ---
At the right bottom part of the question page, you can see a button with the name "info". When you click on it it opens two other buttons. "code" and "log" From the button code you can see your previous submissions, and from the button log, you can see the error log of your submission. This is you submission log. On your fourth line
---------- compiler_stdout.txt ----------

---------- compiler_stderr.txt ----------
solver.cpp: In function `int main()':
solver.cpp:6: error: `cin' undeclared (first use this function)
solver.cpp:6: error: (Each undeclared identifier is reported only once for each function it appears in.)
solver.cpp:17:2: warning: no newline at end of file

imesecanOct.16.2015 at 08:28:03 AM
5In questions it specifies a condition you don't have to check for those conditions, they are guaranteed. And, you shouldn't give extra information like:
cout<<"the sum is"<<A+B<<endl;
And simply say
cout<<A+B<<endl;
Just provide what it asks.

Similarly, when getting information, you don't say,
cout<<"Enter a number..:";
cin>>A;
but simply say
cin>>A;

imesecanOct.29.2015 at 04:16:27 PM
6Please pay attention that for Java submissions main class must have the name solver

--- Java Solution ---
import java.util.Scanner;

public class solver {

public static void main(String[] args) {
Scanner input = new Scanner (System.in);
int a, b, sum=0;

a= input.nextInt();
b= input.nextInt();
sum=a+b;

System.out.println(sum);
}
}


www.contester.ru