现场三人目击事件,只记下车的一些特征。甲说:牌照的前两位数字是相同的;乙说:...
#include <stdio.h>#include <math.h>
void main()
{
int a, b, c, d, n, h;
double t;
for (n = 1000; n < 10000; n++)
{
a = n / 1000;
b = (n - a * 1000) / 100;
d = n % 10;
c = (n % 100 - d) / 10;
t = sqrt(n);
h = sqrt(n);
t = t - h;
if (a == b && d == c && t == 0)
printf("%d", n);
else continue;
}
}
页:
[1]