Algorithm/백준
C++ 알고리즘 - 백준 1259 팰린드롬수
마루설아
2024. 12. 28. 16:13
https://www.acmicpc.net/problem/1259
#include <iostream>
#define endl "\n"
using namespace std;
int main(void) {
// C++ Init
ios::sync_with_stdio(false);
cin.tie(NULL);
string input;
bool check;
while (true) {
check = true;
cin >> input;
if (input == "0") return 0;
for (int i = 0; i < input.size(); i++) {
if (input[i] == input[input.size() - i - 1]) continue;
else {
check = false;
break;
}
}
if (check) cout << "yes" << endl;
else cout << "no" << endl;
}
}