Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstring>
- using namespace std;
- int main() {
- char arr[]="aaaauaaaa";
- int i = 0;
- int len = strlen(arr);
- bool a = true;
- for (i = 0; i <= (len / 2); i++){
- if (arr [i] != arr [len - i - 1] ) {
- a = false;
- break;
- }
- }
- if (a) {
- cout << "Yes" << endl;
- } else {
- cout << "No" << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement