是不是读入问题 代码贴在下面 如果能告诉我哪里出错 帮我改对了 追加分倾家荡产在所不惜~~~ (原谅我没有太多财富)
题目是HDU上的DIY的
2009 Asia Shanghai Regional Contest Host by DHU
最后一题Jinyuetuan Puzzle
readln(cas);
for ii:=1 to cas do
begin
readln(n);
for i:=1 to 7 do
for j:=1 to n do tr[i,j]:=0;
for i:=1 to 7 do
begin
read(tot);read(ch);
for time:=1 to tot do
begin
ss:='';
read(ch);
while (ch' ') and (ch'-') and (not eoln) do
begin
ss:=ss+ch;
read(ch);
end;
if eoln then ss:=ss+ch;
val(ss,x,code);
if ch='-' then
begin
tr[i,x]:=3;
ss:='';
read(ch);
while (ch' ') and (ch'#') and (not eoln) do
begin
ss:=ss+ch;
read(ch);
end;
if eoln then ss:=ss+ch;
val(ss,y,code);
tr[i,y]:=4;
for j:=x+1 to y-1 do tr[i,j]:=2;
end
else tr[i,x]:=1;
end;
readln;
end;
谢谢!!
|