Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <bits/stdc++.h>
- //%lld
- typedef long long ll;
- using namespace std;
- int ver(int n){
- int retorno = 1;
- while(n>0){
- retorno *= n%10;
- n/=10;
- }
- return retorno;
- }
- int main(){
- int n;
- bool a = false;
- cin>>n;
- for(int i = 12;i<=100000;i++){
- if(ver(i)==n){
- cout<<i<<"\n";
- a = true;
- break;
- }
- }
- if(!a)cout<<"-1\n";
- }
Advertisement
Add Comment
Please, Sign In to add comment