|
|
вернуться в форумWhy "Compilation error" {$N+} program a1; var i,j,n,pl:word; s,sum:Extended; res:string; fl,fl2:boolean; begin read(n); read(s); sum:=s; for i:=1 to n-1 do begin read(s); sum:=sum+s; end; str(sum,res); n:=length(res); fl:=false; fl2:=true; for i:=1 to n do begin if res[i]='E' then begin res[i]:='e'; pl:=i; fl:=true; end; if (fl=true){ and (fl2=true)} and (res[pl+1]='0') or (res[i]='+') then begin i:=i-1; fl2:=false; for j:=pl+1 to n do begin res[j]:=res[j+1]; if res[j]<>'0' then fl2:=false; end; end; end; for i:=1 to length(res)-1 do res[i]:=res[i+1]; write(res); end. Re: Why "Compilation error" Послано KIRILL 14 сен 2006 19:19 Because of you try to change variable i , used for cycle For |
|
|