太easy了
2025-04-02 22:17:51
发布于:广东
2阅读
0回复
0点赞
简单
难
#include<iostream>
#include <bits/stdc++.h>
using namespace std;
bool is_pal(int a){
int x=0,y=a;
string num2;
string str_num = std::to_string(a);
num2=str_num;
reverse(str_num.begin(), str_num.end());
if(str_num==num2){
return true;
}else{
return false;
}
}
int main() {
int n;
cin >> n;
if(is_pal(n)) cout << "Yes" << endl;
else cout << "No" << endl;
return 0;
}
这里空空如也
有帮助,赞一个