Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
42052 Xiyou 九进制回文数 C++ 通过 1 MS 252 KB 399 2024-02-24 09:50:21

Tests(1/1):


#include<bits/stdc++.h> using namespace std; int main(){ int jz=9,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; b9=b9+x%jz*pos; pos=pos*10; x/=jz; } if(a9==b9&&flag){ cnt++; } } cout<<cnt; return 0; }


测评信息: