Home > Back-end >  The C language
The C language

Time:04-19

How to implement the output with double loop all daffodil number?
O bosses told

CodePudding user response:

Reference:
 # include & lt; Stdio. H> 

Int main ()
{
Int I, TMP, RMD, sum;
For (I=100; i<=999; I++) {
TMP=I;
sum=0;
While (tmp> 0 {
RMD=TMP % 10;
The sum +=RMD RMD * * RMD;
TMP/=10;
}
If (sum==I) {
Printf (" % d \ n ", I);
}
}
return 0;
}
  • Related