Advertisement
Korotkodul

ege_N2

Mar 30th, 2023
313
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.71 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3. #include <algorithm>
  4.  
  5. using namespace std;
  6.  
  7. bool imp(bool x, bool y) {
  8.     return !x || y;
  9. }
  10.  
  11. bool F(bool x, bool y, bool z, bool w) {
  12.     bool a1 = imp(x, y) || imp(z, w);
  13.     bool a2 = imp(z == y, w == x);
  14.     return a1 && a2;
  15. }
  16.  
  17.  
  18. int main()
  19. {
  20.     vector <bool> v = {0, 1};
  21.     for (bool x: v) {
  22.         for (bool y: v) {
  23.             for (bool z: v) {
  24.                 for (bool w: v) {
  25.                     bool r = F(x, y, z, w);
  26.                     if (r != 0) {
  27.                         continue;
  28.                     }
  29.                     cout << x << ' ' << y << ' ' << z << ' ' << w << ' ' << r << "\n";
  30.                 }
  31.             }
  32.         }
  33.     }
  34. }
  35.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement