Cod sursa(job #869084)
Utilizator | Data | 31 ianuarie 2013 22:11:39 | |
---|---|---|---|
Problema | Factorial | Scor | 10 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.37 kb |
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
ifstream fin("fact.in");
ofstream fout("fact.out");
int n,x=1,z=1,m=1;
fin>>n;
while(n>0)
{
x=x*10;
n--;
}
while(z%x!=0)
{
m++;
z=z*m;
}
fout<<m;
fin.close();
fout.close();
return 0;
}