Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1.
- #include <cstdlib>
- 2.
- #include <iostream>
- 3.
- #include <string>
- 4.
- using namespace std;
- 5.
- 6.
- int main(int argc, char *argv[])
- 7.
- {
- 8.
- char* w = new char[100];
- 9.
- int t;
- 10.
- int cf, cb;
- 11.
- bool eq = true;
- 12.
- string s;
- 13.
- for(cin >> t, cin.getline(w, 100); t > 0; t--, eq = true)
- 14.
- {
- 15.
- w = new char[100];
- 16.
- cin.getline(w, 100);
- 17.
- s = w;
- 18.
- for(cf = 0, cb = s.size()-1; cf < cb; cf++, cb--)
- 19.
- {
- 20.
- if(s[cf] == ' ')
- 21.
- {
- 22.
- cf++;
- 23.
- continue;
- 24.
- }
- 25.
- if(s[cb] == ' ')
- 26.
- {
- 27.
- cb--;
- 28.
- continue;
- 29.
- }
- 30.
- if(s[cb] != s[cf]) eq = false;
- 31.
- }
- 32.
- if(eq == true) cout << "t";
- 33.
- else cout << "n";
- 34.
- if(t > 1) printf("\n", "");
- 35.
- }
- 36.
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement