|
|
back to boardI got WA1! Please help me! {WA1} program Sol; {$APPTYPE CONSOLE} {$O-} uses SysUtils; var ch:char; screen:array[1..80]of char; i,j,cx,cy:integer; begin assign(input,'input.txt'); reset(input); assign(output,'output.txt'); rewrite(output); read(ch); cx:=1; cy:=1; fillchar(screen,sizeof(screen),'#'); while not(eof(input)) do begin case ch of '<': begin dec(cx); if cx<1 then cx:=1 end; '>': begin inc(cx); if cx>80 then cx:=1; end; #10,#13:readln; else screen[cx]:=ch; inc(cx); if cx>80 then cx:=1; end; read(ch); end; for j:=1 to 80 do if screen[j]='#' then write('*') else write(screen[j]); close(input); close(output); end. |
|
|