Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #define X1_REV ((x1+1) % 2)
- #define X2_REV ((x2+1) % 2)
- #define X3_REV ((x3+1) % 2)
- #define Y1_F (x1 & x2) || (X1_REV & X2_REV) || (x1&x2&x3) || (X1_REV&X2_REV&X3_REV)
- #define Y2_F (x1 & x2 & x3)
- using namespace std;
- bool x1 = 0;
- bool x2 = 0;
- bool x3 = 0;
- bool y1, y2;
- bool y1_f[5];
- bool y2_f[5];
- int tableX[9][3] = {
- {0,0,0},
- {0,0,1},
- {0,1,0},
- {0,1,1},
- {1,0,0},
- {1,0,1},
- {1,1,0},
- {1,1,1}
- };
- void printTable()
- {
- for(int i =0; i<8; i++)
- {
- for(int j =0; j<3;j++)
- {
- cout << tableX[i][j] << " ";
- }
- cout << endl;
- }
- }
- void calc()
- {
- for(int i =0; i<8; i++)
- {
- x1 = tableX[i][2];
- x2 = tableX[i][1];
- x3 = tableX[i][0];
- bool y1_f0 = Y1_F;
- bool y2_f0 = Y2_F;
- #define x1 1
- bool y1_f1 = Y1_F;
- bool y2_f1 = Y2_F;
- #undef x1
- bool y1_f2 = Y1_F;
- #define x3 1
- bool y2_f2 = Y2_F;
- #undef x3
- #define X3_REV 0
- bool y1_f3 = Y1_F;
- bool y2_f3 = Y2_F;
- #undef X3_REV
- #define Y1_NEW (x1 & x2) || (X1_REV & X2_REV) || (x1&x2&x3) || 1
- bool y1_f4 = Y1_NEW;
- bool y2_f4 = Y2_F;
- #undef Y1_NEW
- cout << x3 << x2 << x1 << " |" << y1_f0 << " " <<
- y2_f0 << " "<< y1_f1 << " " << y2_f1 << " "<< y1_f2 << " " << y2_f2 <<
- " "<< y1_f3 << " " << y2_f3 <<
- " "<< y1_f4 << " " << y2_f4 << endl;
- //y1 = functionY1();
- // y2 = functionY2();
- // cout << x1 << x2 << x3 << " |" << y1 << " " << y2<<endl;
- }
- }
- int main()
- {
- calc();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement