Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- #define ll long long
- int main()
- {
- ll int b;
- cin>>b;
- for(ll int a=1; a<=15; a++)
- {
- ll int x = 1;
- for(int j=1; j<=a; j++)
- x *= a;
- if(x == b)
- {
- cout<<a<<"\n";
- exit(0);
- }
- }
- cout<<-1<<"\n";
- }
Advertisement
Add Comment
Please, Sign In to add comment