你题目的解答代码如下:
#include <stdio.h>
#include<math.h>
int f1(int n)
{
double t = sqrt(n);
return t == (int)t;
}
int f2(int n)
{
int a,b,c;
a = n / 100;
b = n / 10 % 10;
c = n % 10;
return a!=b && a!=c && b!=c && a<b && b<c;
}
int main()
{
int i;
for (i = 100; i <= 999; i++)
{
if (f1(i) && f2(i))
printf("%d\t%d^2\n", i, (int)sqrt(i));
}
return 0;
}
如有帮助,望采纳!谢谢!
平方数用sqrt该数的结果相乘等于该数判断