Cod sursa(job #221974)
Utilizator | Data | 19 noiembrie 2008 10:08:46 | |
---|---|---|---|
Problema | Factorial | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.32 kb |
#include<stdio.h>
//#include<conio.h>
int n,p,i,s,c;
int main()
{
freopen("fact.in","r",stdin);
freopen("fact.out","w",stdout);
scanf("%d",&p);
for(i=5;s < p;i+=5)
{
c = i;
while(c%5==0)
{
s++;
c = c / 5;
}
}
printf("%d",(i-5));
// getch();
return 0;
}