Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
42056 Songgy_King 九进制回文数 C++ 运行出错 0 MS 232 KB 439 2024-02-24 09:51:17

Tests(0/1):


//九进制回文数 #include<bits/stdc++.h> using namespace std; int main() { int jz=0,cnt=0; int n,m; cin>>n>>m; for(int i=n;i<=m;i++){ int x=i; int a9=0,b9=0,pos=1; bool flag=true; while(x){ if(x%jz%2==0){ flag=false; break; } a9=a9*10+x%jz;//1 b9=b9+x%jz*pos;//1 pos=pos+pos*10; x/=jz;//10 } if(a9==b9&&flag){ cnt++; } } cout<<cnt; return 0; }


测评信息: