Pagini recente » Cod sursa (job #3189734) | Diferente pentru problema/sate intre reviziile 4 si 5 | Cod sursa (job #1258194) | Cod sursa (job #1772747) | Cod sursa (job #274003)
Cod sursa(job #274003)
#include<iostream.h>
#include<fstream.h>
#include<math.h>
int b,k,q;
long a,p;
ifstream f("gfact.in");
ofstream g("gfact.out");
void citire()
{
f>>p>>q;
f.close();
}
main()
{
citire();
long prod=2;
float k;
int b=2;
a=pow(p,q);
k=prod%a;
// int gasit=1;
while(k)
{
b++;
prod=prod*b;
k=prod%a;
}
g<<b;
}