Cod sursa(job #1501413)

Utilizator OlivianOlivian Dan Cretu Olivian Data 13 octombrie 2015 13:37:57
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;
    fin>>p;
    do
    {
        j=N;
        do
        {
            p--;
            j=j/5;
        }while(j%5==0);
        N=N+5;;
    }while(p!=0);
    fout<<N;
}