Cod sursa(job #1865883)
Utilizator | Data | 2 februarie 2017 11:35:32 | |
---|---|---|---|
Problema | Factorial | Scor | 0 |
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,g=0,y,t=0;
cin>>p;
while(p>g)
{
t++;
y=t;
while(y%5==0)
{
y/=5;
g++;
}
}
cout<<t<<endl;
}