Uses crt; type oc=record per,bt,tr:integer; end; ab=record fam,im:string; ocen:oc; end; var b:array [1..50] of ab; l:ab; i,n,g,k,h:integer; begin clrscr; writeln ('введи количество абитуриентов'); readln (n); Writeln ('Вводи фамилии, имена и 3 оценки'); for i:=1 to n do with b[i] do begin readln (fam); readln (im); readln (ocen.per,ocen.bt,ocen.tr); end; clrscr; for j:=1 to n do for i:=1 to n-1 do if b[i].fam>b[i+1].fam then begin l:=b[i]; b[i]:=b[i+1]; b[i+1]:=l; end; writeln ('Список всех аббитуриентов:'); for i:=1 to n do writeln (b[i].fam,' ',b[i].im,' ',b[i].ocen.per,' ',b[i].ocen.bt,' ',b[i].ocen.tr); writeln ('Список допущенных аббитуриентов'); for i:=1 to n do with b[i] do begin with ocen do if (per>30) and (bt>30) and (tr>30) and (per+bt+tr>140) then writeln (fam,' ',im,' ',ocen.per,' ',ocen.bt,' ',ocen.tr); end; readln; end.
1.const N=10; type Vector = array [1..N] of integer; var B: vector; max :integer; procedure IntVector(N: integer; var a: vector); begin for var i := 1 to N do a[i] := random(100); end; procedure OutVector(N: integer; a: vector); begin for var i := 1 to N do begin write(a[i]:5); end; end; procedure Srav (a:vector; N,g:integer); begin g := a[1]; for var i:=1 to N do if (g < a[i]) then g:=a[i]; writeln (g); end; Begin IntVector(N, B); writeln; OutVector(N, B ); writeln; Srav(B,N, max); writeln; End. 2. const N = 10; type Vector = array [1..N] of integer; var B: vector; r,v : real; procedure IntVector(N: integer; var a: vector); begin for var i := 1 to N do a[i] := random(20); end; procedure OutVector(N: integer; a: vector); begin for var i := 1 to N do begin write(a[i]:5); end; end; function srednee(a: vector; N: integer): real; begin for var i := 1 to N do begin result := (result + a[i]); end; end; function kolvo(a: vector; g: real): real; begin for var i := 1 to N do if (a[i] < (srednee(a, N)/10)) then result := result + 1; end; begin IntVector(N, B); writeln; OutVector(N, B ); writeln; writeln ((srednee(B, N)/10):5:3); r := kolvo(B, v); writeln(r); end.
type oc=record
per,bt,tr:integer;
end;
ab=record
fam,im:string;
ocen:oc;
end;
var b:array [1..50] of ab;
l:ab;
i,n,g,k,h:integer;
begin
clrscr;
writeln ('введи количество абитуриентов');
readln (n);
Writeln ('Вводи фамилии, имена и 3 оценки');
for i:=1 to n do
with b[i] do
begin
readln (fam);
readln (im);
readln (ocen.per,ocen.bt,ocen.tr);
end;
clrscr;
for j:=1 to n do
for i:=1 to n-1 do
if b[i].fam>b[i+1].fam then
begin
l:=b[i];
b[i]:=b[i+1];
b[i+1]:=l;
end;
writeln ('Список всех аббитуриентов:');
for i:=1 to n do
writeln (b[i].fam,' ',b[i].im,' ',b[i].ocen.per,' ',b[i].ocen.bt,' ',b[i].ocen.tr);
writeln ('Список допущенных аббитуриентов');
for i:=1 to n do
with b[i] do
begin
with ocen do
if (per>30) and (bt>30) and (tr>30) and (per+bt+tr>140) then writeln (fam,' ',im,' ',ocen.per,' ',ocen.bt,' ',ocen.tr);
end;
readln;
end.
type Vector = array [1..N] of integer;
var B: vector;
max :integer;
procedure IntVector(N: integer; var a: vector);
begin
for var i := 1 to N do a[i] := random(100);
end;
procedure OutVector(N: integer; a: vector);
begin for var i := 1 to N do
begin write(a[i]:5);
end;
end;
procedure Srav (a:vector; N,g:integer);
begin
g := a[1];
for var i:=1 to N do
if (g < a[i]) then g:=a[i];
writeln (g);
end;
Begin
IntVector(N, B);
writeln;
OutVector(N, B );
writeln;
Srav(B,N, max);
writeln;
End.
2. const N = 10;
type Vector = array [1..N] of integer;
var B: vector;
r,v : real;
procedure IntVector(N: integer; var a: vector);
begin
for var i := 1 to N do
a[i] := random(20);
end;
procedure OutVector(N: integer; a: vector);
begin
for var i := 1 to N do
begin
write(a[i]:5);
end;
end;
function srednee(a: vector; N: integer): real;
begin
for var i := 1 to N do begin result := (result + a[i]);
end;
end;
function kolvo(a: vector; g: real): real;
begin
for var i := 1 to N do
if (a[i] < (srednee(a, N)/10)) then result := result + 1;
end;
begin
IntVector(N, B); writeln;
OutVector(N, B );
writeln;
writeln ((srednee(B, N)/10):5:3); r := kolvo(B, v);
writeln(r);
end.