【统计某类完全平方数】2024-12-19
缘由哪错了怎么改 按照我的思路不用函数 哪里不对了我这个为什么不输出编译错误_编程语言-CSDN问答
int IsTheNumber(const int N)
{修改代码
int num[10]{0}, m = 0, a = N;
m = sqrt(N);
if (m*m == N)
{
while (a)
{
++num[a % 10];
a /= 10;
}
for (a = 0; a<10; ++a)
if (num[a] >= 2)
{
printf("%d
", N);
return 1;
}
}
return 0;
}
int n1, n2, cnt = 0;
scanf_s("%d%d", &n1, &n2);
for (int i = n1; i <= n2; i++)
{
if (IsTheNumber(i))++cnt;
}
printf("%d", cnt);











