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 theCodePudding user response:
While () loop body, all the I to the temp.