27th

发布时间 2023-05-29 14:17:16作者: 晨观夕

就上次保守数

因为 90625*90625 超出了int 范围 ,所以改用long long 
#include <bits/stdc++.h>
using namespace std;
int main(){
for(long long i=0;i<100000;i++){
int t=i;
int count=0;
while(t!=0){
t/=10;
count++;//计算i是几位数
}
int k=pow(10,count);//截取后面的几位数 10 count次方
if(i*i%k==i)
cout<<i<<endl;
}

return 0 ;
}