Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- uses crt;
- const
- n = 10;
- m = 10;
- type
- vector = array[1..m] of integer;
- matrix = array[1..n] of vector;
- var
- a: matrix;
- f: text;
- count, i, j: integer;
- firstLine, ourLine: set of integer;
- begin
- clrscr;
- assign(f, 'matrix36.in');
- reset(f);
- for i:=1 to n do
- for j:=1 to m do
- read(f, a[i][j]);
- close(f);
- firstLine:= [];
- for j:=1 to m do
- firstLine := firstLine + [a[i][j]];
- count:=0;
- for i:=2 to n do
- begin
- ourLine:= [];
- for j:=1 to m do
- ourLine:=ourLine + [a[i][j]];
- if firstLine = ourLine then
- count:=count+1;
- end;
- assign(f, 'matrix36.out');
- rewrite(f);
- writeln(f, count);
- close(f);
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement