Cod sursa(job #1490142)

Utilizator RazvanatorHilea Razvan Razvanator Data 22 septembrie 2015 19:42:21
Problema Factorial Scor 20
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.31 kb
#include <iostream>
#include <fstream>

using namespace std;
ifstream f("fact.in");
ofstream g("fact.out");
int main()
{
    int p,n=1,c5=0;
    f>>p;
    while (c5<p) {
        int n1=n;
        while (n1%5==0) {
            c5++;
            n1/=5;
        }
        n++;
    }
    g<<n-1;
}