: , , , , . , . N .
1. :
) (N=10);
) (N=l0);
) (N=10).
) 5- (N=10).
program dz6;
const n=10;
type sports=(skiing, skating, hockey, football, rugby, sambo);
group=set of sports;
groups=array[1..n] of group;
var m1:groups;
x:sports;
A,B,C,D,xm1:group;
i,j,iw,l:integer;
counter: array[sports] of integer;
s:string;
ch:char;
begin
writeln(' : 1-, 2-, 3-, 4-, 5-, 6-');
for j:=1 to n do begin
writeln(' ', j,'- ');
readln(s);
l:=length(s);
for i:=1 to l do begin
ch:=s[i];
case ch of
'1': x:=skiing;
'2': x:=skating;
'3': x:=hockey;
'4': x:=football;
'5': x:=rugby;
'6': x:=sambo;
end;
m1[j]:=m1[j]+[x];
end;
end;
A:=m1[1]; B:=[]; C:=[skiing.. sambo];
for i:=1 to n do begin
A:=A*m1[i]; (* *)
B:=B+m1[i]; (* *)
C:=C-B; (* *)
end;
for i:=1 to 3 do begin
case i of
1: writeln(' ');
2: writeln(' ');
3: writeln(' ');
end;
for x:=skiing to sambo do
if x in A then
case x of
skiing: writeln('');
skating: writeln('');
hockey: writeln('');
football: writeln('');
rugby: writeln('');
sambo: writeln('');
end;
if i=1 then A:=B else A:=C;
end;
writeln(' 3- :');
for x:=skiing to sambo do begin
for i:=1 to n do begin
if(x in m1[i]) then inc(counter[x]);
end;
end;
for x:=skiing to sambo do begin
if(counter[x]>2) then case x of
skiing: writeln('');
skating: writeln('');
hockey: writeln('');
football: writeln('');
rugby: writeln('');
sambo: writeln('');
end;
end;
end.
:
: 1-, 2-, 3-, 4-, 5-, 6-
1-
2-
3-
4-
5-
6-
7-
8-
9-
10-
3- :