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 1307. Archiver

About ends of lines
Posted by Fyodor Menshikov 10 May 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
Posted by Chmel_Tolstiy 13 Jul 2007 02:04
Thanks. Useful hint.
Re: About ends of lines
Posted by TUSUR_lxn 10 Mar 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
Posted by Fyodor Menshikov 3 Apr 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'.