|
|
back to boardI don't know why I got ac. I have writen the program if many similar ways. I don't know why I got ac with this program: const u : set of char = ['A'..'Z','a'..'z']; var s : string; i : integer; ch : char; begin s := ''; while not (eof) do begin read(ch); if ch in u then s := ch+s else begin write(s); write(ch); s := ''; end; end; if ch in u then write(s); end. Re: I don't know why I got ac. by the way, the pascal program should use "read(char)" instead "readln(string)" or you will get crash! Re: I don't know why I got ac. Posted by wyyyl 10 Aug 2006 16:30 Yeah, I don't know, either. I think it sure will be WA. Re: I don't know why I got ac. Posted by RASTA 17 Apr 2009 23:12 may be all the words are palindromes:) Re: I don't know why I got ac. All right. Because s +'abc' will give "sabc", and 'abc' + s will give "abcs". |
|
|