#include <stdio.h>
#include <stdlib.h>
//#define N 3
//int main( )
int main( )
{
int a[10], j;
int count=0, k, temp, y, s, i=0;
for(i=10000; i<=31622; i++)
{
for (j=0; j<10; j++)
a[j]=1;
k=i*i;
temp=0;
y=k;
count++;
//printf("k= %d y= %d count= %d\n", k, y, count);
while (y>0)
{
s=y%10;
y=y/10;
//printf("y= %d s= %d\n", y, s);
if (a[s]==1)
{
a[s]=0;
temp++;
}
else
break;
}
//printf("***temp= %d \n\n", temp);
if (temp==9)
printf("##### k= %d i= %d\n", k, i);
}
printf("\n count= %d ", count);
system ("pause");
return 0;
}
RT,C语言基础应用7-2