Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const n=3;m=4;
- type mas=array[1..n,1..m] of integer;
- var z,v,g:mas; f2:text;
- procedure vv(var a,b,c:mas);
- var i,j:integer;
- begin
- assign(f2,'laba6.txt');
- reset(f2);
- for i:=1 to n do
- begin
- for j:=1 to m do
- readln(f2,a[i,j]);
- readln(f2);
- end;
- readln(f2);
- for i:=1 to n do
- begin
- for j:=1 to m do
- readln(f2,b[i,j]);
- readln(f2);
- end;
- readln(f2);
- for i:=1 to n do
- begin
- for j:=1 to m do
- readln(f2,c[i,j]);
- readln(f2);
- end;
- end;
- function od(x:mas):boolean;
- var i,j,ii,jj:integer;
- f:boolean;
- begin
- f:=false;
- ii:=1;
- while (ii<=n)and(not f) do
- begin
- jj:=1;
- while (jj<=m)and(not f) do
- begin
- i:=1;
- while (i<=n) do
- begin
- j:=1;
- while (j<=m) do
- begin
- if (x[ii,jj]=x[i,j])and((ii<>i)and(jj<>1)) then f:=true;
- inc(j)
- end;
- inc(i)
- end;
- inc(jj)
- end;
- inc(ii)
- end;
- od:=f
- end;
- begin
- vv(z,v,g);
- append(f2);
- writeln(f2,od(z));
- writeln(f2,od(v));
- writeln(f2,od(g));
- close(f2);
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement