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;
}
}
'알고리즘' 카테고리의 다른 글
C++ 알고리즘 - 백준 2609 최대공약수와 최소공배수 (0) | 2024.12.28 |
---|---|
C++ 알고리즘 - 백준 1546 평균 (0) | 2024.12.28 |
C++ 알고리즘 - 백준 15829 Hashing (0) | 2024.12.28 |
C++ 알고리즘 - 백준 2798 블랙잭 (0) | 2024.12.28 |
C++ 알고리즘 - 백준 2525 오븐 시계 (0) | 2024.12.22 |