Pagini recente » Cod sursa (job #2917476) | Atasamentele paginii Profil sweetcitrusflower | Cod sursa (job #797836) | Cod sursa (job #1686426) | Cod sursa (job #2351919)
#include <iostream>
#include <fstream>
using namespace std;
ifstream fin("lgput.in");
ofstream fout("lgput.out");
int pow(int x, int y) {
int a = x, b = y;
int p = 1;
while (b != 1) {
if (b % 2 == 0) {
p *= a * a;
} else {
p *= a * a * a;
}
b /= 2;
}
return p;
}
int main()
{
int a, b;
fin >> a >> b;
fout << pow(a, b);
return 0;
}