Cod sursa(job #1620617)

Utilizator andreiutu111Noroc Andrei Mihail andreiutu111 Data 29 februarie 2016 11:20:31
Problema Factorial Scor 15
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.27 kb
#include    <iostream>
#include    <fstream>
using namespace std;
ifstream f("fact.in");
ofstream g("fact.out");
int main()
{unsigned long long P,x=0,y;
f>>P;
if(P==0) g<<1;
while(P)
{
    x+=5;
    y=x;
    while(!(y%5)){y/=5; P--;}
}
g<<x;
    return 0;
}