Cod sursa(job #2683999)

Utilizator AndreiStreheStreche Andrei Claudiu AndreiStrehe Data 12 decembrie 2020 13:07:33
Problema Factorial Scor 10
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.41 kb
#include <fstream>

using namespace std;

ifstream f("fact.in");
ofstream g("fact.out");

int p,nrzero,nr;

int main()
{
    f>>p;

    if(p==0)
    {
        g<<1;
    }
    else
    {
        while(nrzero!=p)
        {
            nr++;

            if(nr%5==0 || nr%10==0)
            {
                nrzero++;
            }
        }
        g<<nr;
    }



    return 0;
}