1.who was the creator of the flood protection system project? 2) how much money has been invested in this project? 3) how many years was flood protection created? 4) why do i need a flood protection system? help please.
Если элементы массива идут по возрастанию, то вот так
program wstawka; uses crt; const min=1; max=20; type zona=min..max; massiw=array[zona] of integer; var mas:massiw; i,j:zona; a,N,M:integer; T:boolean; BEGIN randomize; clrscr; N:=random(20); writeln('4ucJlo N = ',N); M:=random(20); Writeln('4ucJlo M = ',M); for i:=min to max-2 do begin mas[i+1]:=mas[i]+random(5); write(mas[i],' '); end; for i:=min to max-2 do if (mas[i]>N) and (t=false) then begin t:=true; a:=mas[i]; mas[i]:=N; for j:=i+1 to max do begin N:=mas[j]; mas[j]:=a; a:=N; end; end; for i:=min to max-1 do if (mas[i]>M) and (t=true) then begin t:=false; a:=mas[i]; mas[i]:=M; for j:=i+1 to max do begin M:=mas[j]; mas[j]:=a; a:=M; end; end; writeln; for i:=min to max do write(mas[i],' '); readkey; END.