Cod sursa(job #1687892)
| Utilizator | Data | 13 aprilie 2016 09:42:47 | |
|---|---|---|---|
| Problema | Factorial | Scor | 5 |
| 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.in");
ofstream fout("fact.out");
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;
}
}
