Cod sursa(job #1731736)

Utilizator Codrut10Dascalu Codrut Codrut10 Data 19 iulie 2016 18:49:21
Problema Factorial Scor 15
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.57 kb

#include<iostream>
#include<fstream>
using namespace std;
ifstream f("fact.in");
ofstream g("fact.out");
int x=1,nr,p,ok,n;
int main()
{f>>p;
while(ok==0){for(int i=1;i<=x;i++){n=i;
                                   while(n%5==0){n=n/5;
                                                 nr++;
								                 }
								   }
								    if(nr==p){ok=1;
								              g<<x;
									          }
									if(nr>p)cout<<"nu exista";
									x++;
									nr=0;
                                   }
             
f.close();
g.close();
return 0;
}