Home > Back-end >  This a mistake?
This a mistake?

Time:06-09

Daffodil number
#include

Int main (int arg c, char * argv []) {
int x;//three digits
Int a, [3].//store it every number
Int b=0;
int c;
int i;

For (x=100; X<1000; X++)
{
C=x;
For (I=0; I<3; I++)
{
A [I]=c % 10;
C/=10;
A + b=a [I] * * [I] a [I];
}
If (b==x)
Printf (" % d \ n ", x);
return 0;
}

CodePudding user response:

Wrong on this variable b, but I'm not wrong, the results have nothing, only one press any key to continue

CodePudding user response:

I know mistake, b variables are always changing

CodePudding user response:


I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10581430.html
I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10768339.html
  • Related