Cod sursa(job #1482441)

Utilizator stefanvdpruna stefan stefanvd Data 7 septembrie 2015 10:39:13
Problema Factorial Scor 10
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.33 kb
#include <fstream>
using namespace std;
int k,p,i,x,a;
int main()
{
    ifstream f("fact.in");
    ofstream g("fact.out");
    f>>p;
    while(k<p)
    {a++;
        i++;
        x=i;
        if(x%5==0)
        {k++;
        while((x/5)%5==0)
        k++;}
    }
    if(p==0) g<<1; else
    g<<a;
    return 0;
}