Cod sursa(job #263012)
Utilizator | Data | 19 februarie 2009 20:49:01 | |
---|---|---|---|
Problema | Factorial | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.31 kb |
#include<fstream>
using namespace std;
int main()
{
long p,i=1,l,cif=0,x=1;
ifstream in("fact.in");
ofstream out("fact.out");
in>>p;
l=p;
while (l!=0)
{cif++;
l=l/10;}
while (cif>l)
{i=i*x;
x++;
while (i%10==0)
{i=i/10;
l++;}
out<<x-1;
in.close();
out.close();
return 0;
}