Advertisement
Korotkodul

dem22.n2

Jun 7th, 2023
456
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.02 KB | None | 0 0
  1. /******************************************************************************
  2.  
  3.                               Online C++ Compiler.
  4.                Code, Compile, Run and Debug C++ program online.
  5. Write your code in this editor and press "Run" button to compile and execute it.
  6.  
  7. *******************************************************************************/
  8.  
  9. #include <iostream>
  10. #include <vector>
  11. using namespace std;
  12.  
  13. bool imp(bool a, bool b) {
  14.     return !a || b;
  15. }
  16.  
  17. bool f(bool x, bool y, bool z, bool w) {
  18.     bool A = (x == w);
  19.     A = imp(y, A);
  20.     A = !A;
  21.     bool B = imp(z,x);
  22.     return A && B;
  23. }
  24.  
  25. int main()
  26. {
  27.     vector <bool> v = {0,1};
  28.     for (bool x: v) {
  29.         for (bool y: v) {
  30.             for (bool z: v) {
  31.                 for (bool w: v) {
  32.                     bool F = f(x,y,z,w);
  33.                     if (F) {
  34.                         cout << x << ' ' << y << ' ' << z << ' ' << w << "\n";
  35.                     }
  36.                 }
  37.                
  38.             }
  39.         }
  40.     }
  41. }
  42.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement