Pagini recente » Cod sursa (job #2273412) | Cod sursa (job #1150005) | Cod sursa (job #1785624) | Cod sursa (job #2000256) | Cod sursa (job #2460871)
#include<iostream>
#include<fstream>
#define mod 1999999973
using namespace std;
ifstream in("lgput.in");
ofstream out("lgput.out");
int putere(int baza, int exp) {
int rez = 1;
while (exp > 0) {
if (exp % 2 == 1) {
rez = (1LL * rez*baza) % mod;
}
baza = (1LL*baza * baza)%mod;
exp /= 2;
}
return rez;
}
int main()
{
int n,p;
in >> n>>p;
out << putere(n, p);
system("pause");
}