Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Program Lab4;
- Uses
- CRT;
- Const
- nm=100;
- Type
- mas = array[1..nm] of integer;
- var
- A, B, C, D, F: mas;
- M, N, Mi, Ni, MaxF: integer;
- procedure Input (var L: mas; n: integer);
- var
- i: integer;
- begin
- for i := 1 to n do
- begin
- L[i]:=Random(26)-5;
- end;
- end;
- Function MaxElArr(L: mas):integer;
- var
- i,max: integer;
- begin
- max := L[1];
- for i := 2 to nm do
- if (L[i] > max) then
- max := L[i];
- MaxElArr:=max;
- end;
- procedure Output(H: mas; m: integer);
- var
- i: integer;
- begin
- for i := 1 to m do
- begin
- write(H[i],'; ');
- end;
- Writeln;
- end;
- BEGIN
- TextBackGround(White);
- TextColor(Black);
- ClrScr;
- Randomize;
- write('Enter the number of elements in the array A:');
- readln(N);
- Input(A, N);
- Writeln('Array A:');
- Output(A,N);
- write(#10#13,'Enter the number of elements in the array B:');
- readln(M);
- Input(B, M);
- Writeln('Array B:');
- Output(B,M);
- write(#10#13,'Enter the number of elements in the array C:');
- readln(Ni);
- Input(C, Ni);
- Writeln('Array C:');
- Output(C,Ni);
- write(#10#13,'Enter the number of elements in the array D:');
- readln(Mi);
- Input(D, Mi);
- Writeln('Array D:');
- Output(D,Mi);
- F[1]:=MaxElArr(A);
- F[2]:=MaxElArr(B);
- F[3]:=MaxElArr(C);
- F[4]:=MaxElArr(D);
- Writeln(#10#13,'New array F: ');
- Output(F, 4);
- MaxF:=MaxElArr(F);
- Write(#10#13,'The maximum value of the array F: ', MaxF);
- ReadKey;
- END.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement