Cod sursa(job #262859)
Utilizator | Data | 19 februarie 2009 18:27:56 | |
---|---|---|---|
Problema | Factorial | Scor | 5 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.27 kb |
#include<fstream>
using namespace std;
int main()
{
int p,i,l=1,cif=0;
ifstream in("fact.in");
ofstream out("fact.out");
in>>p;
if (p<25)
i=p*5;
else if (p<125)
i=(p-p/25-p/125-p/625-p/3125)*5;
out<<i;
in.close();
out.close();
return 0;
}