Pagini recente » Diferente pentru happy-coding-2007/solutii intre reviziile 12 si 56 | Cod sursa (job #1839586) | Cod sursa (job #2335956) | Diferente pentru problema/h intre reviziile 3 si 4 | Cod sursa (job #2335856)
#include <iostream>
#include <fstream>
using namespace std;
ifstream f("lgput.in");
ofstream g("lgput.out");
long power(long long x, long long y){
if(y==0)
return 1;
if(y==1)
return x;
long res=power(x,y/2);
if(y%2==0)
return res*res;
return res*res*x;
}
int main(){
long x;
long y;
f>>x>>y;
g<<power(x,y);
}