|
|
back to boardWhy Error №1 ? Posted by Kirill 22 Feb 2009 17:44 Please, help. var A,I,b,Top:integer; Na,Nb:array[1..1000]of integer; procedure OneNumber; begin Nb[1]:=1; Readln(Nb[2]); Top:=2; end; begin readln(a); if a=1 then OneNumber else begin for i:=1 to A do readln(Na[i]); B:=1; Top:=1; for i:=2 to A do if NA[i]=NA[i-1] then begin inc(b); if i=a then begin Nb[Top]:=b;inc(Top);Nb[Top]:=Na[i];end;end else begin Nb[Top]:=b;inc(top);NB[Top]:=Na[i-1];inc(Top);B:=1; if i=a then begin Nb[Top]:=b;inc(Top);Nb[Top]:=Na[i]; end;end;end; for i:=1 to Top do write (Nb[i]); end. |
|
|