Cod sursa(job #1107568)
Utilizator | Data | 13 februarie 2014 22:57:50 | |
---|---|---|---|
Problema | Factorial | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.28 kb |
#include<iostream>
#include<fstream>
#include<math.h>
using namespace std;
ifstream in("fact.in");
ofstream out("fact.out");
int main()
{
int n,p,i,z;
z=1;
in>>p;
i=1;
n=1;
while(z%(pow(10,p)==0))
{
z=z*i;
i=i+1;
n=n+1;
}
out<<n;
return 0;
}