Home > Software engineering >  Pray god to find problems
Pray god to find problems

Time:09-19

The code
 # include 
Void main ()
{int I, j, k=1;
Int x;
While (k<=9)
{
j=0;
While (j<=9)
{
i=0;
While (i<=9)
{
X=100 * k + 10 * j + I;
i++;
If (x==I + j * I * I * j * * * k j + k k)
{
Printf (" % d ", x);
}
}
j++;
}
k++;
}
}


.
The original
Daffodil number refers to the cubic of digits and is equal to the three digits of the number itself, for example, is a daffodil number 153, because 153=13 + 33 + 53, please programming calculation and output all the daffodil number
Why is my code to output a blank, I want to know what is my code has a problem or a problem with the compiler, strives for the great god answer

CodePudding user response:

 
Int main (int arg c, char * argv [])
{
Unsigned int I, j, k=1;
Int x;
While (k<=9)
{
j=0;
While (j<=9)
{
i=0;
While (i<=9)
{
//printf (" % d % d % d;" , k, j, I);
X=100 * k + 10 * j + I;
If (x==I + j * I * I * j * * * k j + k k)
{
Printf (" % d \ n ", x);
}
i++;
}
j++;
//printf (" \ n ");
}
k++;
}//153, 370, 371, 407
return 0;
}
  • Related