Pagini recente » Statistici Luke Ross (mrar3s) | Cod sursa (job #1015093) | Cod sursa (job #467560) | Cod sursa (job #1597849) | Cod sursa (job #246957)
Cod sursa(job #246957)
#include <iostream.h>
#include <stdio.h>
int main()
{int j,n=0,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) ++x;
if(n==125) ++x;
if(n==625) ++x;
if(n==3125) ++x;
if(n==15625) ++x;
if(n==78125) ++x;
if(n==390625) ++x;
if(n==1953125) ++x;
if(n==9765625) ++x;
if(n==48828125) ++x;
if(n==244140625) ++x;
if(n==1220703125) ++x;}
if(x==p) cout<<n;
else cout<<-1;}
fcloseall();
return 0;
}