Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <cstdio>
- using namespace std;
- int main()
- {
- freopen("input.txt", "r", stdin);
- freopen("output.txt", "w", stdout);
- string S, S1 = "", S2 = "", S3;
- getline(cin, S);
- for (int i = 0; i < S.size(); ++i) {
- S2 = S[i];
- if (S2 != " ") {
- S1 += S2;
- }
- }
- S2 = "";
- for (int i = S.size() - 1; i >= 0; --i) {
- S3 = S[i];
- if (S3 != " ") {
- S2 += S3;
- }
- }
- if (S1 == S2) {
- cout << "YES";
- }
- else {
- cout << "NO";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement