Cod sursa(job #1501512)
Utilizator | Data | 13 octombrie 2015 16:38:00 | |
---|---|---|---|
Problema | Factorial | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.39 kb |
#include<cstdio>
using namespace std;
int main ()
{
int N=1,p,j,x=1;
freopen("fact.in","r",stdin);
freopen("fact.out","w",stdout);
scanf("%d",&p);
if(p==0)
{
printf("%d",&x);
}
do
{
j=N;
do
{
p--;
j=j/5;
}while(j%5==0);
N++;
}while(p!=0);
printf("%d",&N);
}