Cod sursa(job #1389999)

Utilizator mihaiilieMihai Ilie mihaiilie Data 16 martie 2015 19:30:53
Problema Factorial Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 1.42 kb
#include <iostream>
#include <fstream>
using namespace std;
ifstream f("prem.in");
ofstream g("prem.out");
int main()
{
    int cop,i,nr,p;
    bool ok;
    f>>p;
    nr=0;
    i=1;
    while(p!=nr)
    {
        i++;
        if(i%10==5)
        nr++;
        cop=i;
        if(i%10==0)
        while(cop!=0)
        {
            if(cop%10==0)
               nr++;
            cop=cop/10;
        }
    }
    g<<i;
}
























































/*void citire()
{
    cout<<"n=";
    cin>>n;
}
void unit(int k)
{
    st[k]=0;
}
bool exista(int k)
{
    if(st[k]<n)
        return true;
            else
                return false;
}
bool cant(int k)
{
    for(i=1;i<=k-1;i++)
        if(st[i]==st[k])
            return false;
                    return true;
}
bool sol(int k)
{
    if(k==n)
        return true;
            else
                return false;
}
void afisare(int k)
{
    for(i=1;i<=n;i++)
    cout<<st[i]<<" ";
    cout<<endl;
}
void bkt()
{
    int k=1;
    while(k>0)
    if(exista(k))
    {
        st[k]=st[k]+1;
        if(cant(k))
            if(sol(k))
                afisare(k);
                else
                {
                    k++;
                    unit(k);
                }
    }
    else k--;
}
int main()
{
    citire();
    bkt();
}
*/