解题思路:
注意事项:
参考代码:
#include<stdio.h>
int f(int n);
int main()
{
int i;
for(i=1000;i<=9999;i++)
if(f(i)) printf("%d ",i);
return 0;
}
int f(int n)
{
int tem,t;
tem=n/100;
t=n%100;
if((tem+t)*(tem+t)==n) return 1;
else return 0;
}
0.0分
1 人评分