Advertisement
Alex_Fomin

Алеся Зубова

Nov 22nd, 2015
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 1.13 KB | None | 0 0
  1. const n=5;
  2.  
  3. var a,b,c,y:set of byte;
  4.     i,p:byte;
  5.  
  6. Function Alesya(n:byte):set of byte;
  7. var i,x:byte;
  8. Begin
  9. i:=1;
  10. While i <= n do
  11.       Begin
  12.       Readln(X);
  13.       if (1 <= X) and (X <= 100) then Begin i+=1; Alesya+=[X]; end
  14.                                  else Writeln('Ошибка :(');
  15.       end;
  16. end;
  17.  
  18. Begin
  19. A:=[]; B:=[]; C:=[]; // Обнулим
  20. Writeln('Введите '+N+' элементов первого множества: '); A:=Alesya(N);
  21. Writeln('Введите '+N+' элементов второго множества: '); B:=Alesya(N);
  22. Writeln('Введите '+N+' элементов третьего множества: '); C:=Alesya(N);
  23.  
  24. Y:=(B*C)-((A*B)+(A*C));
  25.  
  26. Writeln('Сформированное множество:');
  27. for i:=1 to 100 do if (i in Y) then Begin P+=1; Write(i:4); end;
  28. Writeln;
  29. if 20 in Y then Writeln('Число 20 входит во множество') else Writeln('Число 20 не входит во множество');
  30. if 30 in Y then Writeln('Число 30 входит во множество') else Writeln('Число 30 не входит во множество');
  31. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement