Home > Back-end >  Daffodil, strives for the great god give directions!
Daffodil, strives for the great god give directions!

Time:10-02


#include
using namespace std;
Int main () {
Int I, x, sum=0;
For (I=100; i<=999; I++) {
While (i> 0 {
X=I % 10;
The sum +=x x x x x
I/=10;
}
If (sum==I) {
cout}
}
return 0;
}

CodePudding user response:

I/=10 this sentence to modify I do
Below the if (sum==I) inside of the I is 0, is not the original you to determine the number of
You can define an initial value outside of variables is positive p
Will be changed to the while p> 0
Then will I/=10 this changes
P=I;
P/=10;

CodePudding user response:

reference 1st floor m0_44977681 response:
/=10 I have modified this sentence for I
Below the if (sum==I) inside of the I is 0, is not the original you to determine the number of
You can define an initial value outside of variables is positive p
Will be changed to the while p> 0
Then will I/=10 this changes
P=I;
P/=10;

Write the wrong
Is inside the for loop while defined above an int p=I;
Then put the while condition and I have changed to p in the statement