Cod sursa(job #708785)

Utilizator BeniLehelBeni Lehel BeniLehel Data 7 martie 2012 10:44:22
Problema Factorial Scor 10
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.28 kb
#include<stdio.h>
int n,c,q,w=0;
int main()
{
	freopen("fact.in","r",stdin);
	freopen("fact.out","w",stdout);
	scanf("%d",&c);
	int i=0;
	while(c!=w)
	{
		q=5;
		int osz=0;
		while(i/q)
		{
			osz+=i/q;
			q*=5;
		}
		w=osz;
		i++;
	}
	printf("%d",i-1);
	return 0;
}