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