Cod sursa(job #356189)
Utilizator | Data | 13 octombrie 2009 19:30:22 | |
---|---|---|---|
Problema | GFact | Scor | 0 |
Compilator | cpp | Status | done |
Runda | CNRV #2 | Marime | 0.35 kb |
# include <fstream.h>
# include <math.h>
int main(){
double long long a,p,w,q,b;
int i,j,ok,d;
ifstream f("gfact.in");
ofstream g("gfact.out");
f>>p>>q;
a=pow(p,q);
ok=1;d=0;
w=1;
while(w%a!=0){b=1;
d++;
for(i=1;i<=d;i++)b*=i;
w=b;}
g<<d;
f.close();
g.close();
return 0;
}