32 lines
581 B
Plaintext
32 lines
581 B
Plaintext
#include <iostream>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
int main() {
|
|
std::string clovo;
|
|
std::getline(std::cin, clovo);
|
|
|
|
int a = 0;
|
|
int b = clovo.size() - 1;
|
|
bool yesOrNo = true;
|
|
|
|
while (a < b) {
|
|
if (clovo[a] == ' ') {
|
|
++a;
|
|
} else if (clovo[b] == ' ') {
|
|
--b;
|
|
} else if (clovo[a] != clovo[b]) {
|
|
yesOrNo = false;
|
|
break;
|
|
} else {
|
|
++a;
|
|
--b;
|
|
}
|
|
}
|
|
|
|
if (yesOrNo) {
|
|
std::cout << "YES\n";
|
|
} else {
|
|
std::cout << "NO\n";
|
|
}
|
|
} |