ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1000. A+B Problem

Maxim Trouble with the A+B problem [11] // Problem 1000. A+B Problem 13 Sep 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.
Kleninz Re: Trouble with the A+B problem [5] // Problem 1000. A+B Problem 17 Sep 2011 09:20
try this:

#include <iostream>
using namespace std;

int main () {
     long a,b;
     cin >> a;
     cin >> b;
     cout << a+b;
 }
Maxim Re: Trouble with the A+B problem [3] // Problem 1000. A+B Problem 17 Sep 2011 21:27
But, it's the same. (:
divya Re: Trouble with the A+B problem // Problem 1000. A+B Problem 23 Sep 2011 22:42
I think the difference is in return type of main.
Kindly correct if i am wrong.
divya Re: Trouble with the A+B problem [1] // Problem 1000. A+B Problem 23 Sep 2011 22:43
I think the difference is in return type of main.
Kindly correct if i am wrong.
Maxim Re: Trouble with the A+B problem // Problem 1000. A+B Problem 24 Sep 2011 03:21
Thank you so much! Finally it worked!
114081EU Re: Trouble with the A+B problem // Problem 1000. A+B Problem 20 Oct 2011 15:16
no "return"
Anupam Roy Re: Trouble with the A+B problem [1] // Problem 1000. A+B Problem 27 Sep 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
Nikita Glashenko [Samara SAU] Re: Trouble with the A+B problem // Problem 1000. A+B Problem 15 Oct 2011 15:50
use int, lol

Edited by author 15.10.2011 15:51
ReadMe Re: Trouble with the A+B problem // Problem 1000. A+B Problem 23 Oct 2011 00:06
This is an example problem. You should read an FAQ to get start.
Th3_g0d Re: Trouble with the A+B problem // Problem 1000. A+B Problem 25 Oct 2011 19:58
First of all you haven't shown the type of main function :)
green_smile Re: Trouble with the A+B problem // Problem 1000. A+B Problem 7 Nov 2011 21:28
output must be as this :
cout <<(a+b);
or:
cout <<'a+b';


sorry for my English)