Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
55549 | zhangweiran | 中级第五课——找回文数1 | C++ | Accepted | 1 MS | 236 KB | 311 | 2024-11-08 12:27:51 |
#include<bits/stdc++.h> using namespace std; bool hw(string str){ for(int j=0;j<str.length()/2;j++){ if((str[j]==str[str.length()-1-j])){ }else{ return false; } } return true; } int main(){ for(int i=2;i<=10000;i++){ if(hw(to_string(i))==1){ cout<<i<<' '; } } return 0; }