Cod sursa(job #1501415)

Utilizator OlivianOlivian Dan Cretu Olivian Data 13 octombrie 2015 13:39:55
Problema Factorial Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.31 kb
#include<fstream>
using namespace std;
int main ()
{
    ifstream fin("fact.in");
    ofstream fout("fact.out");
    int N=5,p,j,k=0;
    fin>>p;
    do
    {
        j=N;
        do
        {
            k++;
            j=j/5;
        }while(j%5==0);
        N=N+5;;
    }while(k<=p);
    fout<<N;
}