Pagini recente » Istoria paginii utilizator/alexandru1122 | Profil marinmarius | Cod sursa (job #357869) | Cod sursa (job #2140166) | Cod sursa (job #2632674)
#include <bits/stdc++.h>
using namespace std;
const int x=1999999973;
long long n,p,temp;
void fast ()
{
ios_base::sync_with_stdio(false);
cin.tie();
}
long long put (long long a, long long b)
{
if (b==0)
return 1;
if (b%2==0)
{
temp = put (a, b/2);
return temp*temp;
}
if (b%2==1)
{
temp = put (a, (b-1)/2);
return temp*temp*a;
}
}
int main()
{
fast();
freopen("lgput.in","r", stdin);
freopen("lgput.out,"w", stdout);
cin >> n >> p;
cout << put(n,p);
return 0;
}