Код
Const
n1=5;
n2=10;
n3=15;
m1=3;
m2=6;
m3=9;
Dimensions:Array[1..3,1..2] Of Integer = ((n1,m1),(n2,m2),(n3,m3));
Var
a:Array[1..n1,1..m1] Of Integer;
b:Array[1..n2,1..m2] Of Integer;
c:Array[1..n3,1..m3] Of Integer;
i,j,n:Integer;
Function Consists(MassID:Integer;n:Integer):Boolean;
Var
p:^Integer;
i:Integer;
Begin
Case MassID Of
1:p:=@a[1,1];
2:p:=@b[1,1];
Else p:=@c[1,1]
End;
Consists:=True;
For i:=1 To Dimensions[MassID,1]*Dimensions[MassID,2] Do
If p^=n Then
Exit
Else
p:=Ptr(Seg(p^),Ofs(p^)+SizeOf(Integer));
Consists:=False
End;
Begin
For i:=1 To n1 Do
For j:=1 To m1 Do
a[i,j]:=Random(100);
For i:=1 To n2 Do
For j:=1 To m2 Do
b[i,j]:=Random(100);
For i:=1 To n3 Do
For j:=1 To m3 Do
c[i,j]:=Random(100);
n:=Random(100);
j:=0;
For i:=1 To 3 Do
If Consists(i,n) Then
Inc(j);
WriteLn(j)
End.
Должно быть как-то так...