Cod sursa(job #221978)
Utilizator | Data | 19 noiembrie 2008 10:10:48 | |
---|---|---|---|
Problema | Factorial | Scor | 45 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.36 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);
if(p==0)
printf("1");
else
for(i=5;s < p;i+=5)
{
c = i;
while(c%5==0)
{
s++;
c = c / 5;
}
}
printf("%d",(i-5));
// getch();
return 0;
}