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

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

I don't know why mine got problem with the program C++
Послано CJH1996 23 янв 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
Послано strider 23 янв 2009 22:30
Re: the ouput MUST EXACTLY match the specification
Послано CJH1996 24 янв 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++
Послано windT 26 янв 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++
Послано snail 21 ноя 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