Pagini recente » Cod sursa (job #107925) | Cod sursa (job #109161) | Diferente pentru problema/order2 intre reviziile 10 si 9 | Cod sursa (job #2936822) | Cod sursa (job #1944337)
#include <iostream>
#include <fstream>
using namespace std;
ifstream f("lgput.in");
ofstream g("lgput.out");
long long x;
int n;
long long P(long long x,int n)
{
double a;
if(n==0) return 1;
if(n==1) return x;
else
{
a=P(x,n/2);
if(n%2==1) return a*a*x;
else return a*a;
}
}
int main()
{
f>>x>>n;
g<< P(x,n)<< endl;
return 0;
}