Cod sursa(job #1687536)
Utilizator | Data | 12 aprilie 2016 21:59:24 | |
---|---|---|---|
Problema | Factorial | Scor | 10 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.32 kb |
#include <fstream>
using namespace std;
ifstream fin("fact.in");
ofstream fout("fact.out");
long long p,n;
int main()
{fin>>p;
if(p==0)fout<<1;
else
{n=p*5;
if(n>25)n-=5*(n/50);
if(n>50)n-=5*(n/100);
if(n>100)n-=(n/100)*5;
if(n>1000)n-=(n/1000)*5;
fout<<n;
}
return 0;
}