题解 | #守形数#
守形数
https://www.nowcoder.com/practice/99e403f8342b4d0e82f1c1395ba62d7b
#include <stdio.h>
void check(int temp){
int a=temp*temp;
int max=1;
while(1){
if(temp/max==0){
break;
}else{max*=10;}
}
a=a%max;
if(a==temp){printf("Yes!");}
else{printf("No!");}
}
int main() {
int temp;
while(scanf("%d",&temp)!=EOF){
check(temp);
}
return 0;
}
查看9道真题和解析