Home > Back-end >  Of new, from the daffodils,
Of new, from the daffodils,

Time:06-09

My code output 1 ~ 7 a daffodil number, why I three and four potential output, 5, 6 can output,,,,
[/color]



# include
Int main ()
{int N;
The scanf (" % d ", & amp; N);
If (N==3)
{
For (int m=100; m<1000; M++)
{int a, b, c;
A=m % 10;
B=m/100;
C=10% m/10;
If (m==a * a * b + a + b * b * c * c * c)
Printf (" % d \ n ", m);
}
}
The else
If (N==4)
{
For (int m=1000; m<10000; M++)
{

int a,b,c,d;
A=m % 10;
B=m/100% 10;
C=m/1000;
D=m/10% 10;

If (m==a * * a * a * b * b * b * b + c * c * c * d * * * c + d d d)
Printf (" % d \ n ", m);

}
If (N==5)
{
For (int m=10000; m<100000; M++)
{
Int a, b, c, d, e;
A=m % 10;
B=m/100% 10;
C=1000% m/10;
D=m/10% 10;
E=m/10000;
m++;
If (m==a * a * a * a * a * b * b * b * b * b + c * c * c * c * d * * * c + d d d + d * * * * * e e e e e)
Printf (" % d \ n ", m);

}
}
If (N==6)
{
For (int m=100000; m<1000000; M++)
{
Int a, b, c, d, e, f;
A=m % 10;
B=m/100% 10;
C=1000% m/10;
D=m/10% 10;
E=10000% m/10;
F=m/100000;
m++;
If (m==a * a * a * a * a * a * b * b * b * b * b * b + c * c * c * c * * c + d c * * d * * * d d d d + e * * * * * e e e e e + f * f * f * f * f * f)
Printf (" % d \ n ", m);

}
}
If (N==7)
{
For (int m=1000000; m<10000000; M++)
{
Int a, b, c, d, e, f, g;
A=m % 10;
B=m/100% 10;
C=1000% m/10;
D=m/10% 10;
E=10000% m/10;
F=10 m/100000%;
G=m/1000000;
m++;
If (m==a * a * a * a * a * a * a * b * b * b * b * b * b * b + c * c * c * c * c * c * d * * * c + d d d d d * * * * e d + e * * * * * e e e e e + f * f * f * f * f * f * f + g * g * * g * * * g g g g)
Printf (" % d \ n ", m);

}
}

}
}

CodePudding user response:

Suggest you use cycle, write so I don't think anyone is willing to learn programming

CodePudding user response:

You should delete 567 m++ inside it

CodePudding user response:

refer to the second floor qq_45798109 response:
you should delete 567 inside m++ ok

Or useless,,,,,,,,

CodePudding user response:

You a nested loop is wrong, you put the nested in the 4, 567,,,

CodePudding user response:

reference 1st floor qq_45798109 response:
suggest you use cycle, write so I don't think anyone is willing to learn programming.

Just learn, think of how to use,,,, don't know how to use

CodePudding user response:

reference 5 floor qq_45690740 reply:
Quote: refer to 1st floor qq_45798109 response:
suggest you use cycle, write so I don't think anyone is willing to learn programming.

Just learn, think of how to use,,,, don't know how to use

Slowly, come on!!!!!!!!!!

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