Cod sursa(job #1687887)
| Utilizator | Data | 13 aprilie 2016 09:40:29 | |
|---|---|---|---|
| Problema | Factorial | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.38 kb |
#include<iostream>
#include<fstream>
using namespace std;
int p,counter;
long long i;
int main()
{
ifstream fin("fact.out");
ofstream fout("fact.in");
fin>>p;
for(i=1;i<=100000000;++i)
{
int fn=i;
while(fn!=0)
{
if(fn%5==0)counter++;
fn/=5;
}
if(counter==p)fout<<i;break;
}
}
