Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program Project1;
- {$APPTYPE CONSOLE}
- uses
- SysUtils,
- windows;
- const m = 10;
- n = 10;
- type MAS = array[0..9, 0..9] of integer;
- TRange = 0..255;
- TSet = set of TRange;
- const
- Q: MAS = (
- (0, 1, 2, 3, 4, 5, 6, 7, 8, 9),
- (0, 5, 2, 3, 4, 5, 6, 7, 8, 9),
- (0, 9, 2, 3, 4, 5, 6, 7, 8, 9),
- (0, 1, 2, 3, 4, 5, 6, 7, 8, 9),
- (0, 7, 2, 3, 4, 5, 6, 7, 8, 9),
- (0, 3, 2, 3, 4, 5, 6, 7, 8, 9),
- (0, 4, 2, 3, 4, 5, 6, 7, 8, 9),
- (0, 1, 2, 3, 4, 5, 6, 7, 8, 9),
- (15, 14, 13, 12, 11, 10, 9, 8, 7, 6),
- (15, 14, 13, 12, 11, 10, 9, 8, 7, 6)
- );
- var
- x: MAS;
- i, j, k, result: integer;
- x1, x2, x3: TSet;
- begin
- SetConsoleCP(1251);
- SetConsoleOutputCP(1251);
- x1 := [];
- x2 := [];
- x3 := [];
- result := 0;
- i := 0;
- while i < 10 do // i-ñòðîêà => j-ñòîëáåö
- begin
- for j := 0 to 9 do
- include(x1, Q[i, j]);
- inc(i);
- k := i;
- while i < 10 do
- begin
- for j := 0 to n - 1 do
- include(x2, Q[i, j]); ;
- if x1 = x2 then
- begin
- x3 := x3 + x1;
- inc(result);
- end;
- x2 := [];
- inc(i);
- end;
- x1 := [];
- i := k + 1;
- end;
- writeln('êîë-âî ñòðîê=', result);
- readln;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement