Pagini recente » Cod sursa (job #2557584) | loool | Monitorul de evaluare | Istoria paginii runda/dsf | Cod sursa (job #2228343)
#include <iostream>
#include <fstream>
using namespace std;
ifstream f; ofstream g;
long long power(int x, int n)
{
if (n == 0) return (1);
else if (n == 1) return (x);
else if (n % 2) power(x * x, (n - 1) / 2);
else power(x * x, n / 2);
}
int main(void)
{
int n, m;
f.open("lgput.in");
f >> n >> m;
f.close();
g.open("lgput.out");
g << power(n, m);
g.close();
return (0);
}