ENG  RUSTimus Online Judge
Online Judge
Задачи
Авторы
Соревнования
О системе
Часто задаваемые вопросы
Новости сайта
Форум
Ссылки
Архив задач
Отправить на проверку
Состояние проверки
Руководство
Регистрация
Исправить данные
Рейтинг авторов
Текущее соревнование
Расписание
Прошедшие соревнования
Правила
вернуться в форум

Обсуждение задачи 1000. A+B Problem

Trouble with the A+B problem
Послано Maxim 13 сен 2011 23:58
Hi, i'm trying to solve the A+B problem, and it works on my computer. But the compiler of this site doesn't accept my solution. It says "Compilation error" :

"11e2cd04-2636-421c-9639-3a45ac221379
11e2cd04-2636-421c-9639-3a45ac221379(4) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int"

here is my program:

#include <iostream>
using namespace std;

main () {
     long a,b;
     cin >> a;
     cin >> b;
     cout << a+b;
 };
 Where did I do mistakes?
Thank you for attention.
Re: Trouble with the A+B problem
Послано Kleninz 17 сен 2011 09:20
try this:

#include <iostream>
using namespace std;

int main () {
     long a,b;
     cin >> a;
     cin >> b;
     cout << a+b;
 }
Re: Trouble with the A+B problem
Послано Maxim 17 сен 2011 21:27
But, it's the same. (:
Re: Trouble with the A+B problem
Послано divya 23 сен 2011 22:42
I think the difference is in return type of main.
Kindly correct if i am wrong.
Re: Trouble with the A+B problem
Послано divya 23 сен 2011 22:43
I think the difference is in return type of main.
Kindly correct if i am wrong.
Re: Trouble with the A+B problem
Послано Maxim 24 сен 2011 03:21
Thank you so much! Finally it worked!
Re: Trouble with the A+B problem
Послано Anupam Roy 27 сен 2011 20:49
#include<stdio.h>

 void main()
{
    float a,b,s=0.0;
    scanf("%f%f",&a,&b);
    s=a+b;
    printf("sum=%f",s) ;
}
i don't know where is problem in this programme

Edited by author 27.09.2011 20:50
Re: Trouble with the A+B problem
Послано Nikita Glashenko [Samara SAU] 15 окт 2011 15:50
use int, lol

Edited by author 15.10.2011 15:51
Re: Trouble with the A+B problem
Послано 114081EU 20 окт 2011 15:16
no "return"
Re: Trouble with the A+B problem
Послано ReadMe 23 окт 2011 00:06
This is an example problem. You should read an FAQ to get start.
Re: Trouble with the A+B problem
Послано Th3_g0d 25 окт 2011 19:58
First of all you haven't shown the type of main function :)
Re: Trouble with the A+B problem
Послано green_smile 7 ноя 2011 21:28
output must be as this :
cout <<(a+b);
or:
cout <<'a+b';


sorry for my English)