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

What's wrong with it?
Posted by Me 3 Jul 2014 22:03
#include <iostream>
using namespace std;
void main()
{
    int a, b;

    cin >> a >> b;

    cout << "The sum is: " << output << endl;
}
Re: What's wrong with it?
Posted by Marques Traylor 25 Jul 2014 23:22
You didn't declare output:

#include <iostream>

int main()
{
     int a, b;

     std::cout << "Enter first number: ";
     std::cin >> a;

     std::cout << "Enter second number: ";
     std::cin >> b;

     int output = a + b;

     std::cout << "\nThe sum is: " << output << std::endl;

    return 0;

}



Edited by author 25.07.2014 23:23
Re: What's wrong with it?
Posted by Majin Boo 31 Oct 2015 21:27
Your program must read and print only the data that is required in the problem statement. For example, you musn't print "Enter first number: " or "The sum is: ".