링크 : https://www.acmicpc.net/problem/3062
#include <iostream>
#include <algorithm>
using namespace std;
int main(){
int N;
cin >> N;
for(int i = 0; i < N; i++){
string s = "";
cin >> s;
int n = stoi(s);
reverse(s.begin(), s.end());
n += stoi(s);
s = to_string(n);
bool isPalindrome = true;
for(int i = 0; i < s.length() / 2; i++){
if(s[i] != s[s.length() - 1 -i]){
isPalindrome = false;
break;
}
}
if(isPalindrome) cout << "YES" << '\n';
else cout << "NO" << '\n';
}
return 0;
}