Program gt; var n,i,max,min:integer; a:array[1..100]of integer; begin read(n); {n-кол-во учащихся} for i:=1 to n do read(a[i]); max:=a[1]; min:=a[1]; for i:=1 to n do begin if(a[i]>max)then max:=a[i]; if(a[i]<min)then min:=a[i]; end; writeln(max,' ',min,'-росты') max:=max-min; writeln(max); end. 2) program gt; var n,i,a,k:integer; begin read(n); k:=0; for i:=1 to n do begin read(a); if(a<1958)then k:=k+1; end; writeln(k); end. 3) program gt; var i,q,a,l:integer; begin for i:=8 to 20 do begin read(a); if(a<0)then begin q:=q+1; if(q=1)then l:=i; end; end; writeln(l); end.
Uses Crt; const n=10; var a,b:array[1..n] of integer; i,k,t:integer; begin ClrScr; Randomize; for i:=1 to n do begin a[i]:=Random(50); Write(a[i],' ') end; Writeln; for i:=1 to n do begin b[i]:=Random(50); Write(b[i],' ') end; Writeln; Write('k t='); Read(k,t); for i:=1 to n do begin if a[i]>t then a[i]:=a[i]+4; Write(a[i],' ') end; Writeln; for i:=1 to n do begin if b[i]>10*k then b[i]:=b[i]+k; Write(b[i],' ') end; Readkey end.
var n,i,max,min:integer;
a:array[1..100]of integer;
begin
read(n);
{n-кол-во учащихся}
for i:=1 to n do
read(a[i]);
max:=a[1];
min:=a[1];
for i:=1 to n do
begin
if(a[i]>max)then max:=a[i];
if(a[i]<min)then min:=a[i];
end;
writeln(max,' ',min,'-росты')
max:=max-min;
writeln(max);
end.
2)
program gt;
var n,i,a,k:integer;
begin
read(n);
k:=0;
for i:=1 to n do
begin
read(a);
if(a<1958)then k:=k+1;
end;
writeln(k);
end.
3)
program gt;
var i,q,a,l:integer;
begin
for i:=8 to 20 do
begin
read(a);
if(a<0)then begin
q:=q+1;
if(q=1)then l:=i;
end;
end;
writeln(l);
end.
const
n=10;
var
a,b:array[1..n] of integer;
i,k,t:integer;
begin
ClrScr;
Randomize;
for i:=1 to n do begin
a[i]:=Random(50);
Write(a[i],' ')
end;
Writeln;
for i:=1 to n do begin
b[i]:=Random(50);
Write(b[i],' ')
end;
Writeln;
Write('k t='); Read(k,t);
for i:=1 to n do begin
if a[i]>t then a[i]:=a[i]+4;
Write(a[i],' ')
end;
Writeln;
for i:=1 to n do begin
if b[i]>10*k then b[i]:=b[i]+k;
Write(b[i],' ')
end;
Readkey
end.
Тестовое решение:
1 6 23 12 47 1 44 24 6 18
31 30 30 29 0 3 43 32 46 21
k t=2 20
1 6 27 12 51 1 48 28 6 18
33 32 32 31 0 3 45 34 48 23