Cod sursa(job #3201591)
Utilizator | Data | 9 februarie 2024 09:14:24 | |
---|---|---|---|
Problema | Factorial | Scor | 5 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.35 kb |
#include <iostream>
#include <fstream>
#include <cmath>
using namespace std;
ifstream fin("fact.in");
ofstream fout("fact.out");
int main()
{
long long int n,p,x=0;
fin>>n;
while(n!=0)
{
x++;
if(x%25==0)
n=n-pow(2,x/25);
else if(x%5==0 || x%10==0)
n--;
}
fout<<x;
}