word天,这道题写了一早上。。。
1.先用for循环 找出x1-x2之间所有的数字
2.先判断出aabb式的数字
3.再判断出 属于开平方后等于两个一样的数字相乘的
重点:循环里套判断,需要完整输入
#include <stdio.h>
#include <math.h>
int main(){
int x1,x2;
int a,b,e;
scanf("%d %d",&x1,&x2);
for(;x1<=x2;x1++){
a=x1/100;
b=x1%100;
if((a/10==a%10)&&(b/10==b%10)){
e=sqrt(x1);
if(x1==e*e){
printf("%d",x1);
}
}
}
return 0;
}