Advertisement
mamamaria

Samo

Feb 18th, 2021
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.36 KB | None | 0 0
  1.  
  2. #include <iostream>
  3. using namespace std;
  4. int main()
  5. {
  6.     const int N = 3;
  7.  
  8.     unsigned int mas[] = { 0,1,1,0,1,0,0,1 };
  9.     int M = 1 << N; bool check = true;
  10.     for (int i = 0; i < M/2; i++) {
  11.         if (mas[i] != mas[(M-1) - i]) check = true;
  12.         else check = false;
  13.         if (check == false) {
  14.             cout << "no";
  15.             break;
  16.         }
  17.        
  18.     }
  19.     if (check == true) cout << "yas";
  20. }
  21.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement