Home > Back-end >  For bosses to help me take a look at this piece of code: why can't I run
For bosses to help me take a look at this piece of code: why can't I run

Time:03-04

Daffodil number
Include

Int cube (int n) {
Return n * n * n.
}

Int main (void) {
Int the sum, temp, I;
For (I=100; I & lt; 1000; + + I) {
Temp=I;
While (I) {
The sum +=cube (I % 10);
I/=10;
}
If (temp==sum) {
Printf (" % d \ n ", temp);
}
Sum=0;
}
return 0;
}

CodePudding user response:

Temp=I; Later add the sum=0;

CodePudding user response:

The final sum=0; Delete the

CodePudding user response:

While () loop body, all the I to the temp.
  • Related