Cod sursa(job #1090840)
Utilizator | Data | 23 ianuarie 2014 09:53:39 | |
---|---|---|---|
Problema | Factorial | Scor | 10 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.3 kb |
#include<iostream>
#include<fstream>
using namespace std;
ifstream f("fact.in");
ofstream g("fact.out");
int main()
{
long int p,k=0,i=0,x=0;
unsigned long long n=1;
f>>p;
while(k==0)
{
i++;
n=n*i;
while(n%10==0){x++;n=n/10;}
if(x==p)k=1;
}
g<<i;
return 0;
}