讨论 / 弱弱的问题
slzxmty 2008-09-05 04:11:00
点我顶贴 收藏 删除
program ma;

var

n,i,j,l,k,x:longint;

t:boolean;

s:string;

begin

readln(n);

i:=0;

j:=0;

l:=1;

t:=false;

for k:=1 to n do

begin

readln(s);

if s[1]=’l’ then

begin

case l of

1:l:=3;

2:l:=4;

3:l:=2;

4:l:=1;

end

end

else

if s[1]=’r’ then

begin

case l of

1:l:=4;

2:l:=3;

3:l:=1;

4:l:=2;

end;

end

else

begin

t:=true;

val(s,x);

case l of

1:inc(j,x);

2:dec(j,x);

3:dec(i,x);

4:inc(i,x);

end;

writeln(’(’,i,’,’,j,’)’);

end;

end;

if not(t) then

write(’(0,0)’);

end.

#1 lychees@2008-09-05 04:11:00
回复 删除
楼主貌似只贴了代码...

问题都没问= - 真是...

#2 lychees@2008-09-05 04:11:00
回复 删除
我理解错了- -
查看更多回复
提交回复