讨论 / 不会吧!这道题我写了35行代码,竟然只得了10分!
870725697(pas) 2013-07-15 23:03:00
点我顶贴 收藏 删除
program pro40(input,output);

const

fail='Ignored';

type

web=array[1..100] of string[70];

var

a,b:web;

s:string[70];

i,j,x:integer;

begin

readln(s);

while s<>'QUIT' do

begin

i:=i+1;

{ERROR}

if (s[1]='V') and (s[2]='I') and (s[3]='S') and (s[4]='I') and (s[5]='T') then

begin

x:=x+1;

j:=j+1;

a[j]:=copy(s,7,length(s));

b[i]:=a[j];

end else

if s='BACK' then if x<>1 then

begin

x:=x-1;

b[i]:=a[x];

end else b[i]:=fail

else if s='FORWARD' then if x<i then

begin

x:=x+1;

b[i]:=a[x];

end else b[i]:=fail;

readln(s);

end;

for j:=1 to i do writeln(b[j]);

end.

#1 870725697(pas)@2012-03-15 04:56:00
回复 删除
代码我发错了,纠正一下

program pro40(input,output);

const

fail='Ignored';

type

web=array[1..100] of string[70];

var

a,b:web;

s:string[70];

i,j,x:integer;

begin

readln(s);

while s<>'QUIT' do

begin

i:=i+1;

if (s[1]='V') and (s[2]='I') and (s[3]='S') and (s[4]='I') and (s[5]='T') then

begin

x:=x+1;

j:=j+1;

a[j]:=copy(s,7,length(s));

b[i]:=a[j];

end else

if s='BACK' then if x<>1 then

begin

x:=x-1;

b[i]:=a[x];

end else b[i]:=fail

else if s='FORWARD' then if x<i then

begin

x:=x+1;

b[i]:=a[x];

end else b[i]:=fail;

readln(s);

end;

for j:=1 to i do writeln(b[j]);

end.

#2 某魔塔一路暴狂@2013-07-15 23:03:00
回复 删除
不会吧!这道题我写了28行代码,竟然得了100分!

#3 朝夕@2014-10-10 21:26:35
回复 删除
卧槽

#4 朝夕@2014-10-10 21:27:02
回复 删除
回复 #1 870725697(pas):卧槽
#5 balck_desk@2014-10-13 02:12:46
回复 删除
大哥……你只读了一行吧……
#6 Denverjin@2015-08-10 20:28:27
回复 删除
回复 #2 某魔塔一路暴狂:给一个代码,行吗?
#7 zpszdyf@2015-08-11 19:51:55
回复 删除
哪题= =

#8 Sentinel Prome@2015-08-11 21:29:19
回复 删除
回复 #7 zpszdyf:讨论的右上角不是有个跳转至 题目吗,为什么感觉很多人不知道
查看更多回复
提交回复