Cod sursa(job #857128)
Utilizator | Data | 17 ianuarie 2013 13:21:14 | |
---|---|---|---|
Problema | Factorial | Scor | 10 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.31 kb |
#include<iostream>
#include<fstream>
using namespace std;
ifstream in("fact.in");
ofstream out("fact.out");
int p;
int main()
{
int aux;
in>>p;
aux=p;
do
{
if(p%5) p=p-1;
aux=aux/5;
}
while(aux>1);
out<<(p*5) - ((((p*5)/25)-1)*5);
in.close();
out.close();
return 0;
}