#include <iostream>
#include <string>
using namespace std;

int main()
{
	string num = "";
	bool isPalindrome;
	while (cin >> num, num != "0")
	{
		isPalindrome = true;
		for (int i = 0; i < num.length() / 2; ++i) {
			if (num[i] != num[num.length() - i - 1]) {
				isPalindrome = false;
				break;
			}
		}
		if (isPalindrome == true)
			cout << "yes" << endl;
		else
			cout << "no" << endl;
	}

	return 0;
}

출력에 개행문자 넣어줘야한다.

 

https://www.acmicpc.net/problem/1259

 

1259번: 팰린드롬수

입력은 여러 개의 테스트 케이스로 이루어져 있으며, 각 줄마다 1 이상 99999 이하의 정수가 주어진다. 입력의 마지막 줄에는 0이 주어지며, 이 줄은 문제에 포함되지 않는다.

www.acmicpc.net