Pagini recente » Cod sursa (job #897192) | Cod sursa (job #1730418) | Cod sursa (job #2140483) | Cod sursa (job #1938602) | Cod sursa (job #1734062)
#include <iostream>
#include <fstream>
#include <math.h>
using namespace std;
ifstream fin("fact.in");
ofstream fout("fact.out");
int p,n,i;
int scadere(int p)
{
int x,y,aux;
x=5;
y=1;
while(x*y<p)
{
y++;
}
return x*(y-1);
}
int main()
{
fin>>p;
if(p==0)
fout<<1;
else if(p==1)
fout<<5;
else
{
n=p*5;
if(p>=2&&p<=4)
fout<<n;
else if(p>=6)
{
cout<<scadere(p);
fout<<n-scadere(p);}
}
fin.close();
fout.close();
return 0;
}