题目
输出所有形如aabb的4位完全平方数(即前两位相等,后两位数字也相等)
#include<stdio.h>
#include<math.h>
int main() {
for (int x = 1; ; x++)
{
int n = x * x;
if (n < 1000) continue;
if (n > 9999) break;
int hi = n / 100;
int lo = n % 100;
if (hi / 10 == hi % 10 && lo / 10 == lo % 10)
printf("%d\n", n);//x列举,n取范围,
}
return 0;
}
if (hi / 10 == hi % 10 && lo / 10 == lo % 10) 无法理解这一段,先码着