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

I don't know why mine got problem with the program C++
Posted by CJH1996 23 Jan 2009 19:04
#include<iostream>
using namespace std;
int main()
{
    int a,b;
    cout<<"a" <<endl;
    cin>>a;
    cout<<"b" <<endl;
    cin>>b;
    cout<<a+b <<endl;
    system("pause");
}

Can you tell me what's the prob?????????
the ouput MUST EXACTLY match the specification
Posted by strider 23 Jan 2009 22:30
Re: the ouput MUST EXACTLY match the specification
Posted by CJH1996 24 Jan 2009 11:41
I don't understand what is the meaning of output and input even though i read the website you have told me. Can you briefly tell me about the meaning of output and input and the meaning of these two? I hope I can learn something from you.
Re: I don't know why mine got problem with the program C++
Posted by windT 26 Jan 2009 18:08
This problem haven't say print "a"and"b"letter before input.So I change your programme.
 #include<iostream>
using namespace std;
int main()
{
int a,b;

cin>>a;

cin>>b;
cout<<a+b <<endl;
system("pause");//return 0;
}
Re: I don't know why mine got problem with the program C++
Posted by snail 21 Nov 2009 15:00
this can be better:
#include<iostream>
using namespace std;
int main()
{
  int a,b;
  while(cin>>a>>b)
  {cout<<a+b<<endl;}
  return 0;
}

Edited by author 21.11.2009 15:02