Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
324793 方相宜 【C6-2】小丽找半个回文数? C++ 编译错误 0 0 MS 0 KB 619 2025-05-31 15:07:18

Tests(0/0):


#include <bits/stdc++.h> using namespace std; long long LL; void toR(LL x,int d){ char c; s=""; while(x>0){ if(x%d<10){ c=x%d+'0'; }else{ c=x%d+'A'-10; } s=c+s; x=x/d; } } bool hw(LL y){ int a=0,w,t; t=y; while(t>0){ w=t%10; a=a*10+w; t=t/10; } if(y==a){ return 1; } return 0; } int main() { int n; cin>>n; for(int i=1;i<=n;i++){ cin>>m; if(hw(m)) continue; for(int j=2;j<=16;j=j+14){ toR(m,j); s2=s; reverse(s.begin(),s.end()); if(s2==s){ cout<<m<<endl; } } } return 0; }


测评信息: