Cod sursa(job #2769986)
Utilizator | Data | 18 august 2021 17:34:38 | |
---|---|---|---|
Problema | Factorial | Scor | 5 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.35 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream f("fact.in");
ofstream g("fact.out");
long long a;
int cmmdc(int a, int b)
{
if(b == 0)
return a;
return cmmdc(b, a % b);
}
int main()
{
f >> a;
long long rez = 1;
for(int i = 1; i <= a; i++)
rez *= i;
g << rez;
return 0;
}