Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
26890 | 老方 | 中级第五课——找回文数1 | C++ | Accepted | 1 MS | 248 KB | 313 | 2023-09-21 21:44:56 |
#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; }