Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string.h>
- using namespace std;
- int main()
- {
- char s[256];
- int i = 0;
- cin.getline(s, 256);
- int a,b,f;
- f = 1;
- a = 0;
- b = strlen(s) - 1;
- while ( a < b ){
- while (s[b] == ' ' ){
- b = b - 1;
- }
- while (s[a] == ' '){
- a = a + 1;
- }
- if ( s[a] != s[b] ){
- f = 0;
- cout << a << " " << b << endl;
- }
- a = a + 1;
- b = b - 1;
- }
- if ( f == 1){
- cout << "yes";
- }else
- cout << "no";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement