Pagini recente » Cod sursa (job #1134528) | Cod sursa (job #1650057) | Istoria paginii utilizator/paduchele007 | Cod sursa (job #2423090) | Cod sursa (job #246961)
Cod sursa(job #246961)
#include <iostream.h>
#include <stdio.h>
int main()
{int j,x=0,i;
long p,n=0;
freopen("fact.in", "r", stdin);
freopen("fact.out", "w", stdout);
cin>>p;
if(p==0) {cout<<1; return 0;}
else
{while(x<p)
{++x;
n=n+5;
if(n%25==0) ++x;
if(n%125==0) ++x;
if(n%625==0) ++x;
if(n%3125==0) ++x;
if(n%15625==0) ++x;
if(n%78125==0) ++x;
if(n%390625==0) ++x;
if(n%1953125==0) ++x;
if(n%9765625==0) ++x;
if(n%48828125==0) ++x;
if(n%244140625==0) ++x;
if(n%1220703125==0) ++x;}
if(x==p) cout<<n;
else cout<<-1;}
fcloseall();
return 0;
}