Cod sursa(job #1373370)
Utilizator | Data | 4 martie 2015 18:18:29 | |
---|---|---|---|
Problema | Factorial | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.41 kb |
#include <iostream>
#include <fstream>
#include <cmath>
using namespace std;
int main()
{
ifstream f;
ofstream g;
f.open("factorial.in");
int k=0, p;
long int i;
f >> p;
f.close();
g.open("factorial.out");
for (i=1; i <= 100000000; i++)
{
if (i % 5 == 0)
{
k = k + 1;
}
if (k == p)
{
g << i;
system("pause");
break;
}
}
g.close();
return 0;
}