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 1601. AntiCAPS

Hhelp
Posted by Respect1 27 Dec 2012 14:56
Как понять когда она завершила ввод сообщения?
Re: Hhelp
Posted by Berendea 29 Dec 2012 02:16
Please use english. I translated your question with google translate and it said "How do you know when it has completed writing a message?".
Well, it depends on the programming language you are using.

Pascal: while not(eof(input)) (not sure if it was input)
C: you usualy use while(!feof(stdin)) http://www.cplusplus.com/reference/cstdio/feof/
   This doesn't seem to work (for me at least).
C++: I think it's !cin.eof() (I've never used this one).
Re: Hhelp
Posted by Zefick 7 Feb 2013 12:20
> C: you usualy use while(!feof(stdin)) http://www.cplusplus.com/reference/cstdio/feof/
>    This doesn't seem to work (for me at least).
  This does not work if you read lines with gets and write it with puts, but feof(stdin) is works fine. May be some problems with linefeeds. Stupid MSVS.

Edited by author 07.02.2013 12:20

Edited by author 07.02.2013 12:20
Re: Hhelp
Posted by [TDUweAI] daminus 26 Jun 2013 21:51
on pascal

while not eoln do
 begin
  read(g_string);
  ......
  ......
 end;
Re: Hhelp
Posted by Evgeniy[VVV] 29 Jan 2016 18:21
on java:
 Scanner scan = new Scanner(System.in);
while (scan.hasNext()){
  s = scan.nextLine();
}
Re: Hhelp
Posted by Andrewshn 29 May 2023 02:04
on python
message = sys.stdin.readlines()
and then ctrl+D to stop input