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

Обсуждение задачи 1414. Астрономическая база данных

Hi, i'm having problems with the input of this task.

How does my program know when the input is over?

It would be very helpful if you could give me a code sample (only the input, not the actual task :) ). Something like:

#what libraries the input needs

while(way to know the input is over)
{
way_to_read (scanf, cin ...something else?)
}

Thanks, I believe if i get this part, the rest will work first time :)


char s[1000];

while (scanf("%s", s) != EOF)
{
  ....
}

Edited by author 19.09.2007 21:04
Vladimir Yakovlev (USU) read faq [1] // Задача 1414. Астрономическая база данных 20 сен 2007 15:55
Denis Koshman Re: read faq // Задача 1414. Астрономическая база данных 17 авг 2008 23:52
while(scanf("%s", s) == 1)

Edited by author 17.08.2008 23:53