Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- bool shtrix(bool a, bool b){
- return !(a|b);
- }
- bool xor2(bool a,bool b){
- return shtrix(shtrix(shtrix(shtrix(a,a),b),shtrix(shtrix(b,b),a)),shtrix(shtrix(shtrix(a,a),b),shtrix(shtrix(b,b),a)));
- }
- bool s(bool a, bool b, bool c){
- return xor2(xor2(a,b),c);
- }
- bool kon2(bool a, bool b){
- return shtrix(shtrix(a,a),shtrix(b,b));
- }
- bool dis2(bool a, bool b){
- return shtrix(shtrix(a,b),shtrix(a,b));
- }
- bool p(bool a, bool b, bool c){
- return dis2(kon2(dis2(b,a),c),kon2(b,a));
- }
- int main()
- {
- bool a = true;
- bool b = true;
- bool c = true;
- cout << "c a b s p" << endl;
- for (int i = 0; i <= 1; i++){
- c = !c;
- for (int j = 0; j <= 1; j++){
- a = !a;
- for (int f = 0; f <= 1; f++){
- b = !b;
- cout << c << ' ' << a << ' ' << b << ' ' << s(a,b,c) << ' ' << p(a,b,c) << endl;
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement