static int[] getFlower () {
int[] arr = new int[4];
int index = 0;
for (int x = 1;x < 10;x++ )
{
for (int y = 0;y < 10;y++ )
{
for (int z = 0;z < 10;z++ )
{
if ((x*100+y*10+z)==(x*x*x+y*y*y+z*z*z))
{
arr[index] = (x*100+y*10+z);
index++;
}
}
}
}
return arr;
} |
|