Advertisement
Guest User

Untitled

a guest
Feb 8th, 2016
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. program skjdak;
  2. type slicice=1..20;
  3. skup=set of slicice;
  4. var
  5. n,m,i,x:integer;
  6. s1,s2,s3,s4,s5,s6:skup;
  7.  
  8. procedure ulaz(var s1,s2,s3,s4:skup; var x,n,m:integer);
  9. begin
  10. s1:=[]; s2:=[]; s3:=[]; s4:=[];
  11. writeln('Unesite broj slicica prvog coveka');
  12. readln(n);
  13. writeln('Unesite brojeve slicica');
  14. for i:=1 to n do begin
  15. read(x);
  16. if not (x in s1) then s1:=s1+[x]
  17. else s2:=s2+[x];
  18. end;
  19. writeln('Unesite broj slicica drugog coveka');
  20. readln(m);
  21. writeln('Unesite brojeve slicica');
  22. for i:=1 to m do begin
  23. read(x);
  24. if not (x in s3) then s3:=s3+[x]
  25. else s4:=s4+[x];
  26. end;
  27. end;
  28.  
  29. procedure obrada(s1,s2,s3,s4:skup; var s5,s6:skup);
  30. begin
  31. s5:=s2-s3 ;
  32. s6:=s4-s1;
  33. end;
  34.  
  35.  
  36. procedure izlaz(s5,s6:skup);
  37. begin
  38. write('Prvi menja',' ');
  39. if s5=[] then write('Nista');
  40. for i:=1 to 20 do
  41. if (i in s5) then write(i,' ');
  42. writeln();
  43. write('Drugi menja');
  44. if s6=[] then write('Nista');
  45. for i:=1 to 20 do
  46. if (i in s6) then write(i,' ');
  47. readln(n);
  48. end;
  49.  
  50. begin
  51. ulaz(s1,s2,s3,s4,x,n,m);
  52. obrada(s1,s2,s3,s4,s5,s6);
  53. izlaz(s5,s6);
  54. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement