讨论 / 为什么编译不通过 家里的可以
beana 2011-10-27 00:22:00
点我顶贴 收藏 删除
题目:火星人

状态: Compile Error

测评机: Xeost[5]

得分: 0分

提交日期: 2010-7-31 16:48:00

有效耗时: 该状态没有记录

编译错误:

Free Pascal Compiler version 2.0.4 [2006/08/21] for i386

Copyright (c) 1993-2006 by Florian Klaempfl

Target OS: Win32 for i386

Compiling //RQNOJ:UserCode\340251.pas

340251.pas(10,40) Error: Illegal assignment to for-loop variable "i"

340251.pas(38,4) Fatal: There were 1 errors compiling module, stopping

340251.pas(38,4) Fatal: Compilation aborted

Error: //RQNOJ:Bin\FP\bin\i386-win32\ppc386.exe returned an error exitcode (normal if you did not specify a source file to be compiled)

提交代码

var

add,n,i1,j,incc:integer;

s,t:array[1..10000] of integer;

procedure cao(no:integer);

var

i:integer;

begin

for i:=1 to n do

begin

if incc=0 then i:=s[n-no+1];

begin

if t[i]=0 then

begin

t[i]:=no;

if no=1 then inc(incc)

else cao(no-1);

if incc=(add+1) then exit;

t[i]:=0;

end;

end;

end;

end;

begin

readln(n);

readln(add);

for i1:=1 to n do

read(s[i1]);

incc:=0;

fillchar(t,sizeof(t),0);

cao(n);

for i1:=n downto 1 do

for j:=1 to n do

if t[j]=i1 then write(j,' ');

end.

#1 w703710691d@2011-08-25 19:00:00
回复 删除
无语

“if incc=0 then i:=s[n-no+1]”;

干什么啊?

#2 zengyanjie1999@2011-08-29 06:20:00
回复 删除
你没定义 i
#3 zengyanjie1999@2011-08-31 04:50:00
回复 删除
朋友,要给分啊
#4 许烨闻@2011-09-02 06:34:00
回复 删除
回复LS,i是定义的,i是局部变量。

for i:=1 to n do

begin

if incc=0 then i:=s[n-no+1];

已经有点乱了。

两个i最好改其一。。。

#5 lijiaming12340@2011-09-02 21:32:00
回复 删除
。。。。
#6 程子@2011-10-27 00:22:00
回复 删除
编译器版本不一样。我在用FP2.4.4

编译器版本不一样。我在用FP2.4.4

查看更多回复
提交回复