Cod sursa(job #2699826)
Utilizator | Data | 25 ianuarie 2021 22:29:52 | |
---|---|---|---|
Problema | Factorial | Scor | 5 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.39 kb |
#include <iostream>
#include <fstream>
#include <math.h>
using namespace std;
ifstream fin("fact.in.in");
ofstream fout("fact.out");
long long int p;
void solve()
{
unsigned long long int ni=1;int j=1;
while(true) {
ni*=j;
if(ni % int(pow(10,p)) == 0) {
break;
}
j++;
}
fout<<j;
}
int main()
{
fin>>p;
solve();
}