Pagini recente » Diferente pentru problema/hamster intre reviziile 55 si 64 | Cod sursa (job #2720618) | Cod sursa (job #248805) | Cod sursa (job #151485) | Cod sursa (job #121261)
Cod sursa(job #121261)
#include<iostream.h>
#include<conio.h>
#include<stdio.h>
int main ()
{long int P,N,N2,p=0;
freopen("FACT.in", "rt", stdin);
freopen("FACT.out", "wt", stdout);
cin>>P;
for(N=5;p!=P;N=N+5) {N2=N;
while (N%5==0) {N=N/5;
p++;}
N=N2;
if (p==P) {cout<<N;break;}
if (p>P) {cout<<"nu exista solutie";break;}}
return 0;
}