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 1098. Questions

I still can't understand how does the input can be read
Posted by Marin Radu 1 Jul 2005 16:18
A tried C++ streams and C scanf,read,gets. Nothing seems to work. Could someone show me how to read the input...
Re: I still can't understand how does the input can be read
Posted by Tayeb Al Karim 28 Jul 2005 05:02
    string data = "";
    while(!cin.eof()){
        char buffer[31000];
        memset(buffer, 0, 31000);
        cin.getline(buffer, 31000);
        data += buffer;
    }
Re: I still can't understand how does the input can be read
Posted by Bors Magic 4 Aug 2006 17:29
Or:
string all;
char c;
while (cin.get(c))
if ( c != '\n') all+=c;
Re: I still can't understand how does the input can be read
Posted by Tbilisi SU: Eldar Bogdanov 29 Sep 2006 17:21
Could anybody tell me how should I read the input in Pascal?

My code gets WA on test 7. This is how I input the data:

  while not eof do
  begin
    read(s[i]);
    if (ord(s[i])=13) or (ord(s[i])=10) then dec(i);
    inc(i);
  end;