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

Обсуждение задачи 1001. Обратный корень

How do I know when the input has ended?
Послано HappyPerson 8 мар 2012 04:25
I know this might sound stupid, but how am I supposed to know when I've finished inputting numbers? I don't see anything saying what A is equal to, so how do I know?
Re: How do I know when the input has ended?
Послано Erop [USU] 9 мар 2012 13:50
read FAQ.

for C++:

double n;
while (scanf("%lf", &n) != EOF)
{
   ...
}
Re: How do I know when the input has ended?
Послано dims 7 июн 2012 20:58
I have the same question.
What about Java? there's no answer to that in FAQ.
Re: How do I know when the input has ended?
Послано Noob 7 июн 2012 22:12
Just catch Exception :D
Re: How do I know when the input has ended?
Послано Haji 24 янв 2013 12:21
How to make the EOF? I mean how does it know when the user stopped inputting?
Re: How do I know when the input has ended?
Послано Megakrit 25 янв 2013 22:58
As for C#, you can use (as an example):

string[] inputValues = Console.In.ReadToEnd().Split(new char[] {' ', '\t', '\n', '\r'}, StringSplitOptions.RemoveEmptyEntries);
Re: How do I know when the input has ended?
Послано Your_Y 2 фев 2013 14:58
///
Edited by author 02.02.2013 14:58

Edited by author 02.02.2013 14:58
Re: How do I know when the input has ended?
Послано Faruk 3 дек 2014 10:40
I have same prblm in  c.
Re: How do I know when the input has ended?
Послано Pavel Nikolov 11 дек 2014 14:46
I have the same problem with Go. Can someone help me.
Re: How do I know when the input has ended?
Послано Romina 24 дек 2014 23:57
For windows command prompt CTRL Z would be interpreted as EOF
Re: How do I know when the input has ended?
Послано Ashfaqur Rahman 17 авг 2015 05:01
For linux terminal Ctrl + d is the EOF character.
Re: How do I know when the input has ended?
Послано Vikrant Sharma 5 ноя 2015 10:24
You'll know the input has ended when one of the following happens, depending on the method you choose to read in the first place :

InputStreamReader in;
while(in.read() != -1)

BufferedReader in;
while((line = in.readLine()) != null)
Re: How do I know when the input has ended?
Послано Vikrant Sharma 5 ноя 2015 10:24
You'll know the input has ended when one of the following happens, depending on the method you choose to read in the first place :

InputStreamReader in;
while(in.read() != -1)

BufferedReader in;
while((line = in.readLine()) != null)