Advertisement
Guest User

Untitled

a guest
Dec 5th, 2016
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. private function iloczynliczb($zbiorA,$zbiorB)
  2. {
  3. $wynik=Array();
  4. for($l=0;$l<count($zbiorA);$l++)
  5. {
  6. if(in_array($zbiorA[$l], $zbiorB))
  7. {
  8. $wynik[]=$zbiorA[$l];
  9.  
  10. return $wynik;
  11. }
  12.  
  13. }
  14. }
  15. public function iloczyn()
  16. {
  17. echo("Iloczyn:");
  18. if(count($this->zbiory)>0)
  19. {
  20. $this->wynik=$this->zbiory[0];
  21. for($i=1;$i<count($this->zbiory);$i++)
  22. {
  23. $this->wynik=$this->iloczynliczb($this->zbiory[$i],$this->wynik);
  24. }
  25. }
  26. else
  27. {
  28. $this->wynik=Array();
  29. }
  30. }
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37. function suma ($first,$second) {
  38. 2
  39.  
  40. 3
  41. return $first | $second;
  42. 4
  43. }
  44.  
  45.  
  46. function iloczyn ($first,$second) {
  47. 2
  48.  
  49. 3
  50. return $first & $second;
  51. 4
  52. }
  53.  
  54.  
  55. function roznica ($first,$second) {
  56. 2
  57.  
  58. 3
  59. return $first & ~$second;
  60. 4
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement