Cod sursa(job #847780)
Utilizator | Data | 4 ianuarie 2013 14:59:38 | |
---|---|---|---|
Problema | Factorial | Scor | 5 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.33 kb |
#include <iostream>
#include <fstream>
using namespace std;
ifstream f("fact.in");
ofstream g("fact.out");
int main()
{
long long p,n,i,c,j;
f>>p;
i=1;
c=0;
n=1;
for(j=1;j<=p;j++)
{
i=i*10;
}
while(n%i!=0)
{
c++;
n=n*c;
}
g<<c;
}