Cod sursa(job #2618044)

Utilizator Cioarec_GeorgeCioarec George Cioarec_George Data 23 mai 2020 16:09:32
Problema Factorial Scor 30
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.36 kb
#include <iostream>
#include<fstream>

using namespace std;

ifstream f("fact.in");
ofstream g("fact.out");

int main()
{
    int n, x=0, r=0;
    f>>n;
    if(n==0)
        x=1;
    while(r<n)
    {
        x+=5;
        int aux=x;
        while(aux%5==0)
        {
            aux/=5;
            r++;
        }
    }
    g<<x;
    return 0;
}