Cod sursa(job #1482446)

Utilizator stefanvdpruna stefan stefanvd Data 7 septembrie 2015 10:49:28
Problema Factorial Scor 40
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.36 kb
#include <fstream>
using namespace std;
int k,p,i,x,a;
int main()
{
    ifstream f("fact.in");
    ofstream g("fact.out");
    f>>p;
    i=0;
    while(k<p)
     {
        i=i+5;
        x=i;
        k++;
        while((x/5)%5==0)
        {
         x=x/5;
         k++;
        }
     }
    if(p==0) g<<1; else
    g<<i;

    return 0;
}