Cod sursa(job #1156157)

Utilizator teoceltare01teo cons teoceltare01 Data 27 martie 2014 14:37:42
Problema Factorial Scor 35
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.32 kb
#include<iostream>
#include<fstream>
using namespace std;
int main()
{
    ifstream fin("fact.in");
    ofstream fout("fact.out");
    int n,x=0,e=0,y;
    fin>>n;
    while(e<n)
    {
        x+=5;
        y=x;
        while(y%5==0)
        {
            e++;
            y/=5;
        }
    }
    fout<<x;
}