3 条题解
-
412209水宇辰 (12209水宇辰) LV 9 @ 2021-11-28 11:04:37
#include <iostream> using namespace std; int main() { int n,s,x=0; cin>>n; s=n; while(s>0) { x=x*10+s%10; s=s/10; } if(x==n) { cout<<"Yes"<<endl; } else { cout<<"No"<<endl; } return 0; }
-
12024-08-06 10:34:30@
#include <iostream>
#include <string>bool isPalindrome(int x) {
if (x < 0) return false;
std::string numStr = std::to_string(x);
int len = numStr.length();
for (int i = 0; i < len / 2; ++i) {
if (numStr[i] != numStr[len - 1 - i]) {
return false;
}
}
return true;
}int main() {
int x;
std::cin >> x;
if (isPalindrome(x)) {
std::cout << "Yes" << std::endl;
} else {
std::cout << "No" << std::endl;
}
return 0;
}
//541881314 -
12024-07-20 20:36:43@
#include<iostream> using namespace std; int n,nt,k; int main() { cin>>n; nt=n; while(nt) { k=k*10+nt%10; nt=nt/10; } if(k==n) cout<<"Yes"; else cout<<"No"; }
- 1
信息
- ID
- 1639
- 难度
- 4
- 分类
- (无)
- 标签
- 递交数
- 189
- 已通过
- 83
- 通过率
- 44%
- 上传者