|
|
back to boardTest #7 I've tried to solve this problem using lists and with the Josephus algorithm and both approaches had WA7, it seems I can't read the input properly. I've tried different approaches here, too: 1. while not eof do begin read(s[i]); if (ord(s[i])=13) or (ord(s[i])=10) then dec(i); inc(i); end; 2. repeat readln(ss); for i:=len+1 to len+length(ss) do s[i]:=ss[i-len]; len:=len+length(ss); until eof; And many others, but I always get WA7. What's that test?! Re: Test #7 No suggestions? :D Re: Test #7 This input is OK: txt := ''; while not eof do begin read(c); if c in [#10,#13] then continue; txt := txt + c; end; Re: Test #7 Thank you :) I've got accepted, but it turned out that my problem wasn't in reading the input and I realized it only after getting WA7 with your inputting fragment, too. I outputed 'No comment' instead of 'No comments'... :D Edited by author 16.10.2006 16:24 Edited by author 16.10.2006 16:24 Re: Test #7 The same trouble with you |
|
|