Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int n, db=0, zsak, ossz=0;
- for(int x; x<=1000000; x++){
- n = x;
- while (n>0) {
- db++;
- n/= 10;
- }
- n = x;
- while (n>0) {
- zsak = n%10;
- for (int i=1; i<db; i++)
- zsak *= n%10;
- ossz += zsak;
- n /= 10;
- }
- if (x == ossz)
- cout << x <<" ";
- }
- cout<< endl;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement