Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.98 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. bool shtrix(bool a, bool b){
  6.     return !(a|b);
  7. }
  8.  
  9. bool xor2(bool a,bool b){
  10.     return shtrix(shtrix(shtrix(shtrix(a,a),b),shtrix(shtrix(b,b),a)),shtrix(shtrix(shtrix(a,a),b),shtrix(shtrix(b,b),a)));
  11. }
  12.  
  13. bool s(bool a, bool b, bool c){
  14.     return xor2(xor2(a,b),c);
  15. }
  16.  
  17. bool kon2(bool a, bool b){
  18.     return shtrix(shtrix(a,a),shtrix(b,b));
  19. }
  20.  
  21. bool dis2(bool a, bool b){
  22.     return shtrix(shtrix(a,b),shtrix(a,b));
  23. }
  24.  
  25. bool p(bool a, bool b, bool c){
  26.     return dis2(kon2(dis2(b,a),c),kon2(b,a));
  27. }
  28.  
  29. int main()
  30. {
  31.     bool a = true;
  32.     bool b = true;
  33.     bool c = true;
  34.     cout << "c a b s p" << endl;
  35.     for (int i = 0; i <= 1; i++){
  36.         c = !c;
  37.         for (int j = 0; j <= 1; j++){
  38.             a = !a;
  39.             for (int f = 0; f <= 1; f++){
  40.                 b = !b;
  41.                 cout << c << ' ' << a << ' ' << b << ' ' << s(a,b,c) << ' ' << p(a,b,c) << endl;
  42.             }
  43.         }
  44.     }
  45.     return 0;
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement