Advertisement
DMG

Kazna (S) - prelose rjesenje

DMG
Apr 3rd, 2013
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int broj (long long a)
  5. {
  6.     int p = 1;
  7.     while(a>0)
  8.     {
  9.               p *= (a%10);
  10.               a = a / 10;
  11.     }
  12.    
  13.     return p;
  14. }
  15.  
  16. main()
  17. {
  18.       int n;
  19.       long long i=1;
  20.      
  21.       cin >> n;
  22.      
  23.       do
  24.       {
  25.           i = i + 1;
  26.       }
  27.       while (broj(i)!=n);
  28.      
  29.       cout << i << endl;
  30.      
  31.       system("PAUSE");
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement