#include <stdio.h>
#include <stdlib.h>
int power(int a, int b)
{
return (b==0) ? 1 : a*power(a,b-1); }
int LeiPi(int num)
{
int n = num;
int len = 0, sum = 0;
int half,halfone,halftwo;
while(n)
{
n = n/10; len++; }
n = num;
for(half = 1; half<len; half++)
{
halfone = n%(power(10,half));
halftwo = n/(power(10,half));
sum = halfone + halftwo;
if((sum*sum) == num)
{
printf("[%4d][%4d]",halftwo,halfone);
return 1;
}
}
return 0;
}
int main()
{
int j=0,i,n;
for(i = 4; i<10000; i++)
{
n = i*i;
if( LeiPi(n) )
{
printf("->%-8d ",n); j++; }
if( j == 3 )
{
printf("\n"); j
= 0; }
}
return 0;
}