Cod sursa(job #1221712)

Utilizator cristighrCristi Gherghina cristighr Data 21 august 2014 12:18:30
Problema Factorial Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.48 kb
#include <iostream>
#include <fstream>
using namespace std;

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

int main()
{
    int p;
    f>>p;

    int x=1,i=1;
    int k=0;
    while(x)
    {
        x=x*i;
        i++;
        while(x)
        {   if(k!=p)
            {
                if(x%10==0)
                {
                    x=x/10; k++;
                }
            }
            else
                g<<i;

        }
    }



    return 0;
}