AlbertMourato

Untitled

Feb 24th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.45 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <bits/stdc++.h>
  3. //%lld
  4. typedef long long ll;
  5. using namespace std;
  6. int ver(int n){
  7.     int retorno = 1;
  8.     while(n>0){
  9.         retorno *= n%10;
  10.         n/=10;
  11.     }
  12.     return retorno;
  13. }
  14. int main(){
  15.     int n;
  16.     bool a = false;
  17.     cin>>n;
  18.     for(int i = 12;i<=100000;i++){
  19.         if(ver(i)==n){
  20.             cout<<i<<"\n";
  21.             a = true;
  22.             break;
  23.         }
  24.     }
  25.     if(!a)cout<<"-1\n";
  26. }
Advertisement
Add Comment
Please, Sign In to add comment