ГлавнаяСборникиТурнирыРазделыФорумыУчастникиПечатьПомощьО системе

Форумы > Обсуждение задач > тема:


Задача "A+B"

Идёт турнир!

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

imesecan20.сен.2015 в 12:00:59
0-- Test 1 ---
1
2

--- Pattern ---
3

imesecan16.окт.2015 в 08:26:07
1--- Python solution ---
a = int(input())
b = int(input())

print(a+b)

imesecan16.окт.2015 в 08:26:40
2--- C++ Solution ---
#include <iostream>
using namespace std;
int main()
{
int A, B;
cin>>A;
cin>>B;
cout<<A+B<<endl;
return 0;
}

imesecan16.окт.2015 в 08:27:00
3--- Pascal Solution ---
uses SysUtils;
var
a, b: Integer;
begin
ReadLn(a,b);
WriteLn(a + b);
end.

imesecan16.окт.2015 в 08:27:50
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

imesecan16.окт.2015 в 08:28:03
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;

imesecan29.окт.2015 в 16:16:27
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