Advertisement
fteussh

one more hell,please

Aug 26th, 2015
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.40 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstring>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7.  
  8.   char arr[]="aaaauaaaa";
  9.   int i = 0;
  10.   int len = strlen(arr);
  11.   bool a = true;
  12.  
  13.   for (i = 0; i <= (len / 2); i++){
  14.     if (arr [i] != arr [len - i - 1] ) {
  15.       a = false;
  16.     break;
  17.     }
  18.   }
  19.     if (a) {
  20.      cout << "Yes" << endl;  
  21.     } else {
  22.       cout << "No" << endl;
  23.     }
  24.  
  25.   return 0;
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement