#include<bits/stdc++.h>
using namespace std;
bool func(int n){
int m = n * n;
string m_str = to_string(m);
string n_str = to_string(n);
int i = m_str.length() - 1;
int j = n_str.length() - 1;
while(j >= 0){
if(m_str[i] != n_str[j]){
return false;
}
i--;
j--;
}
return true;
}
int main(){
int n;
while(cin >> n){
if(func(n)) cout << "Yes!" << endl;
else cout << "No!" << endl;
}
return 0;
}
字符串真好用

京公网安备 11010502036488号