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

Обсуждение задачи 1307. Архиватор

About ends of lines
Послано Fyodor Menshikov 10 май 2007 01:43
When //CPP archive type is chosen one must pay attention to the following:

C++ compiler works under Windows, so when you print to stdout one character with code 10 (\n) it prints two characters: 13 and 10 (CR LF)

Be sure to print only one character 10 (not 13 and then 10) for each end of line in input.
Re: About ends of lines
Послано Chmel_Tolstiy 13 июл 2007 02:04
Thanks. Useful hint.
Re: About ends of lines
Послано TUSUR_lxn 10 мар 2010 10:02
Please tell me how can I write only one '\n'?
On my computer I use _setmode( _fileno( stdin[stdout] ), _O_BINARY );
it is in <io.h> header, and there is no such header on timus server.

how can I write only one '\n' with out using binary reading/writing? or how can I open stdin in binary mode?

Edited by author 10.03.2010 10:03
Re: About ends of lines
Послано Fyodor Menshikov 3 апр 2010 23:47
Correction: in default (text) mode you need to write only '\n'. In binary mode (if you can enable it) you would need to write both '\r' and '\n'.