Advertisement
Guest User

Untitled

a guest
Dec 15th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.43 KB | None | 0 0
  1.  int n, db=0, zsak, ossz=0;
  2.     for(int x; x<=1000000; x++){
  3.         n = x;
  4.         while (n>0) {
  5.             db++;
  6.             n/= 10;
  7.         }
  8.      
  9.         n = x;
  10.         while (n>0) {
  11.             zsak = n%10;
  12.             for (int i=1; i<db; i++)
  13.                 zsak *= n%10;
  14.             ossz += zsak;
  15.             n /= 10;
  16.         }
  17.      
  18.         if (x == ossz)
  19.             cout << x <<" ";
  20.     }
  21.     cout<< endl;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement