Cod sursa(job #677347)
| Utilizator | Data | 10 februarie 2012 01:08:06 | |
|---|---|---|---|
| Problema | Factorial | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.27 kb |
#include <fstream>
#include <math.h>
using namespace std;
int main()
{ifstream fin("fact.in");
ofstream fout("fact.out");
int n, p;
fin>>p;
n=5*p-p/5-p/25-p/125-p/625-p/pow((double)5,5)-p/pow((double)5,6)-p/pow((double)5,7)-p/pow((double)5,8);
fout<<n;
return 0;
}