Cod sursa(job #2237928)
Utilizator | Data | 3 septembrie 2018 22:55:47 | |
---|---|---|---|
Problema | Factorial | Scor | 5 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.25 kb |
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
ifstream fin("fact.in");
ofstream fout("fact.out");
long long int n, p=1;
fin>>n;
for (int k=2; k<=n; k++)
{
p*=k;
}
fout<<p;
}