Cod sursa(job #1950584)
Utilizator | Data | 3 aprilie 2017 10:14:24 | |
---|---|---|---|
Problema | Factorial | Scor | 5 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.29 kb |
#include <fstream>
using namespace std;
ifstream fin("fact.in");
ofstream fout("fact.out");
int main()
{
int n;
fin >> n;
long long fact {1};
for (int i = 1; i <= n; ++i)
fact *= i;
fout << fact;
fin.close();
fout.close();
return 0;
}