1. c.
2. c.
3. .
.
(4, 5). .
Program change_;
Var
a:array[1..4,1..5] of integer;
i,n:byte;
buf:integer;
BEGIN
Writeln( (4*5));
Randomize;
For i:=1 to 4 do
For n:=1 to 5 do
a[I,n]:= integer(random(100))-50;
writeln( );
For i:=1 to 4 do
begin
For n:=1 to 5 do
Write(a[I,n]:4);
Writeln
End;
For i:=1 to 4 do
Begin
Buf:=a[I,4];
a[I,4]:= a[I,5];
a[I,5]:= Buf
End;
writeln( );
For i:=1 to 4 do
begin
For n:=1 to 5 do
Write(a[I,n]:4);
Writeln
End
END.
.
n . .
Program St _;
type
size=l..100:
mas=array[size] of' integer;
var
arr_: mas;
i,n,k: size;
Buf: integer;
BEGIN
Write( );
Readln(n);
Writeln( RR_);
Randomize;
For i:=1 to n do
Arr_[I]:= integer(random(100))-50;
writeln( );
For i:=1 to n do
Write(arr_[i]:4);
Writeln;
For i:=1 to n-1 do
For k:=i+1 to n do
If arr_[i]> arr_[k] then
begin
buf:= arr_[i];
arr_[i]:= arr_[k];
arr_[k]:=buf
End;
writeln( );
For i:=1 to n do
Write(a[i]:4);
Writeln;
END.
4.
.
1. ( ) / .
2. ( ) .
.
( , ) .
:
;
, +1- ;
0.
{$R+}
Program My;
Const
MaxN=10;la=-10;ha=21; { }
Type
MyArray=Array[1..MaxN] Of Integer;
Var
A:MyArray;
k:Integer;
Procedure Init(t,v,w:Integer; Var X:MyArray);{ }
Var
I:Integer;
Begin
Randomize;
For i:=1 To t Do
X[i]:=v+Integer(Random(w));
End;
Procedure Print(t:Integer;X:MyArray);{ t X}
Var
i:Integer;
Begin
For i:=l To t Do
Write(X[i]:5);
WriteLn;
End;
Function Max(t:Integer;X:MyArray):Integer;
{ }
Var
i,mx:Integer;
Begin
mx:=1;
For i: =2 To t Do
If X[i]>=X[Mx] Then Mx:=i;
|
|
Max:=Mx;
End;
Procedure Sz (t,q:Integer;Var X:MyArray);{ , q+1}
Var
i:Integer;
Begin
For i:=q To t-1 Do
X[i]:=X[i+1];
X[t]:=0;
End;
Begin
n:=MaxN;
Init(n,la,ha,A);
WriteLn (' ');
Print(n,A);
k:=Max(n,A);
Sz(n,k,A);
WriteLn( ');
Print(n-1,A);
ReadLn;
END.
.
3 (5*4,4*5,5*5), . . , . , .
{$R+}
Const
MaxN=5; =5;
Type
TMyArray=Array[l..MaxN,l..MaxM] Of Integer;
Var
A,B,C:TMyArray;
Res:array[1..3] of Integer;
M,n,max:Integer;
Procedure Init(t,v:Integer; Var X:TMyArray);{ }
Var
I,j:Integer;
Begin
Randomize;
For i:=l To t Do
For j:=1 To v Do
X[I,j]:=Integer(Random(50))-20;
End;
For i:=l To t Do
Procedure Print(t,v:Integer;X:TMyArray);{ }
Var
I,j:Integer;
Begin
For i:=l To t Do
Begin
For j:=1 To v Do
Write(X[I,j]:5);
WriteLn;
End;
End;
Function Min(t,v:Integer;X:TmyArray):Integer;{ }
Var
i,j:Integer;
Begin
Min:=X[1,1]:
For i:=l To t Do
For j:=1 To v Do
If abs(X[I,j])<abs(min) then
min:=X[I,j];
End;
Begin{ 0 }
Init(5,4,A);
Init(4,5,B);
Init(5,5,C);
Writeln( ); Print(5,4,A);
Writeln( B); Print(4,5,B);
Writeln( C); Print(5,5,C);
Res[1]:=Min(5,4,A);
Res[2]:=Min(4,5,B);
Res[3]:=Min(5,5,C);
Max:=Res[1];
For n:=2 to 3 do
If Res[n]>max then
begin
Max:=res[n];
M:=n
End;
Writeln( );
Case m of
1: Print(5,4,A);
2: Print(4,5,B);
3: Print(5,5,C);
End;
END.
5