Auto commit

This commit is contained in:
2025-02-21 09:14:54 +08:00
parent 4e52aad31a
commit 6a22303f9a
2 changed files with 40 additions and 0 deletions
@@ -0,0 +1,20 @@
#include <stdio.h>
int main(){
int i, s, t;//i用来遍历所有数, s用来存储数的位数,t是截取掉最高位之后的数
for(i=1;i<9999;i++){
t = i;
while(t > 0){
s = (t/10==0?1:(t/100==0?2:(t/1000==0?3:4)));//求出这个数字位数
t = i%(int)pow(10, s-1);//使用模除去掉最高位
if(t*t == i){
printf("%d:%d\n", t, i);
}
}
}
return 0;
}