Created
February 21, 2017 21:27
-
-
Save jorendorff/254807d9122315a975bc89884d565c9f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| using namespace std; | |
| int main() { | |
| const int P[8] = {0, 0, 0, 0, 1, 1, 1, 1}; | |
| const int Q[8] = {0, 0, 1, 1, 0, 0, 1, 1}; | |
| int first_array[8]; | |
| char first = 'P'; | |
| // --------------------------------------- | |
| for (int i =0;i<8;i++){ | |
| if (first=='P'){ | |
| first_array[i]=(!P[i]||Q[i]); | |
| } | |
| if (first=='Q'){ | |
| first_array[i]=(!Q[i]||P[i]); | |
| } | |
| } | |
| for (int i=0;i<8;i++){ | |
| cout<<first_array[i]<<endl; | |
| } | |
| // --------------------------------------- | |
| return 0; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 0 | |
| 0 | |
| 1 | |
| 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment