|
|
вернуться в форумHelp! What's wrong with this program? (Any help aprecciated) Var ch: char; i,n: integer; a: array [1..255] of char; Begin n:= 0; Repeat read(ch); if (ch in ['a'..'z']) or (ch in ['A'..'Z']) then begin Inc(n); a[n]:= ch; end else begin for n:= n downto 1 do write(a[n]); n:= 0; write(ch); end; until (eof); End. Re: Help! It's difficult to say. There were some problems about this problem, because many people solved during the online contest? and then recieved an e-mail where i8t was written that it was a mistake, and it's WA. Re: Help! > What's wrong with this program? (Any help aprecciated) > > Var > ch: char; > i,n: integer; > a: array [1..255] of char; > > Begin > n:= 0; > Repeat > read(ch); > if (ch in ['a'..'z']) or > (ch in ['A'..'Z']) then begin > Inc(n); > a[n]:= ch; > end > else begin
> for n:= n downto 1 do > write(a[n]); > n:= 0; > write(ch); > end; > until (eof); > End. When you press key "Enter" it contains two symbol, but you cna only read one. Thanks!, but... Thanks for the help! How can I fix that problem? |
|
|