ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1413. Mars Jumper

help!! 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!