Factorial


Submit solution

Points: 10
Time limit: 5.0s
Memory limit: 256M

Author:
Problem type
Allowed languages
C#, Go, Java

Escriu un algorisme recursiu per a calcular el factorial d'un nombre:

Exemple

5! = 5*4*3*2*1 = 120

Input Format

Un nombre enter.

Constraints

No hi ha.

Output Format

El factorial.

Test Case 1

Input
1
Output
1

Test Case 2

Input
2
Output
2

Test Case 3

Input
3
Output
6

Test Case 4

Input
5
Output
120

Test Case 5

Input
10
Output
3628800

Test Case 6

Input
15
Output
2004310016

Authorship: Gerard Falcó

CC BY-NC-SA 4.0