|
|
back to boardI still can't understand how does the input can be read 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 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 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 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; |
|
|