|
|
back to boardhelp!! Wa2 Posted by garnett 20 Sep 2009 12:55 This is my program: program V1413; const b=sqrt(2)/2; var x,y:real; st:ansistring; i:longint; begin x:=0;y:=0; readln(st); for i:=1 to length(st) do begin case st[i] of '8':y:=y+1; '2':y:=y-1; '4':x:=x-1; '6':x:=x+1; '7':begin x:=x-b; y:=y+b; end; '9':begin x:=x+b; y:=y+b; end; '1':begin x:=x-b; y:=y-b; end; '3':begin x:=x+b; y:=y-b; end; '0':begin writeln(x:0:10,' ',y:0:10); halt; end; end; end; end. I don't know why wa2 ? Sorry for my bad English.Thank you! |
|
|