Pagini recente » Borderou de evaluare (job #2057373) | Cod sursa (job #2088700) | Cod sursa (job #655483) | Cod sursa (job #2973806) | Cod sursa (job #2251372)
#include <iostream>
#include <fstream>
using namespace std;
long long a,b,p,q;
ifstream fin("gfact.in");
ofstream fout("gfact.out");
int putere(int x,int n)
{ int rez=1;
while(n)
{
rez=rez*x;
n--;
}
return rez;
}
int main()
{ fin>>p>>q;
a=putere(p,q);
int f=1,ok=0;
for(int i=2;ok==0;i++)
{
f=f*i;
b=i;
if(f%a==0)
ok=1;
}
fout<<b;
return 0;
}