Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
324252 | 陈信宇 | 【C6-2】小丽找半个回文数? | C++ | 通过 | 100 | 1 MS | 252 KB | 669 | 2025-05-25 12:40:32 |
#include<bits/stdc++.h> using namespace std; string s; string s1; string s2; long long m; void sgh(long long x,int y){ char c; s=""; while(x>0){ if(x%y<10){ c=x%y+'0'; }else{ c=x%y+'A'-10; } s=c+s; x/=y; } } bool sb(long long d){ int a=0; int w,t; t=d; while(t>0){ w=t%10; a=a*10+w; t/=10; } if(d==a) return 1; return 0; } int main(){ int n; cin>>n; for(int i=1;i<=n;i++){ cin>>m; if(sb(m)) continue; for(int j=2;j<=16;j+=14){ sgh(m,j); s2=s; reverse(s.begin(),s.end()); if(s2==s){ cout<<m<<endl; } } } return 0; }