Cod sursa(job #355774)
| Utilizator | Data | 12 octombrie 2009 09:30:21 | |
|---|---|---|---|
| Problema | GFact | Scor | 10 |
| Compilator | cpp | Status | done |
| Runda | CNRV #2 | Marime | 0.29 kb |
#include <stdio.h>
#include <math.h>
int main()
{ long a,b,i,x,m=1,d=1;
FILE *f=fopen("gfact.in","r");
FILE *g=fopen ("gfact.out","w");
fscanf (f,"%d",&a);
fscanf (f,"%d",&b);
x=pow(a,b);
while (m%x!=0) {
m=m*d;
d++;
}d-=1;
fprintf (g,"%d",d);
fclose (f);
fclose (g);
return 0;
}