Cod sursa(job #3167296)

Utilizator mafteimatei dia maftei Data 10 noiembrie 2023 16:05:12
Problema Factorial Scor 80
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.53 kb
#include <iostream>
#include <fstream>
using namespace std;
ifstream fin("fact.in");
ofstream fout("fact.out");
int p,cnt,i,aux;
int main()
{
    ifstream fin("fact.in");
    ofstream fout("fact.out");
    fin>>p;
    if(p!=0)
    {
        while(cnt<p)
        {
            i++;
            aux=i;
            while(aux%5==0)
            {
                cnt++;
                aux/=5;
            }
            cnt++;
        }
        fout<<i*5;
    }
    else
    {
        fout<<1;
    }
    return 0;
}