Cod sursa(job #2135383)

Utilizator cristiandreiBargan Cristian Andrei cristiandrei Data 18 februarie 2018 19:53:09
Problema Factorial Scor 20
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.33 kb
#include <fstream>

using namespace std;

int main()
{
    long i, aux,p;
    ifstream f("fact.in");
    ofstream g("fact.out");
    f>>p;
    i=0;
    while(p)
    {
        i=i+5;
        aux=i;
        while(aux%5==0)
        {
            aux=aux/5;
            p--;
        }
    }
    g<<i;
    return 0;
}