Calcular factorial


Enviar solució

Punts: 3
Temps Límit: 1.0s
Límit de memòria: 64M

Autor/a:
tipus del problema
Bucles simples
Categoria
Introduccio
Llenguatges permesos
Bash, C#, Haskell, Java, Kotlin, PHP, Python

Anem a fer operacions matemàtiques. Donat un nombre enter n >= 0 calcula el seu factorial (n!). Ajuda : si n> 2 , n! = n (n-1) (n-2) …. 1 0! = 1 i 1! = 1

Entrada

La primera línia indica els casos de prova a considerar Cada cas compta amb 1 linea amb un número enter positiu

Sortida

Per cada cas de prova caldrà mostrar el resultat de n!

Exemple d'Entrada

3
2
6
4

Exemple de Sortida

2
720
24

Comentaris


  • 0
    adrianrevert  comentat a les oct. 24, 2024, 11:53 a.m.

    chamorro prime


  • 0
    Yujiang31  comentat a les oct. 7, 2024, 1:05 p.m.

    ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣤⣤⣤⣤⣴⣦⣤⣤⣤⣤⣤⣄⣀⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⣶⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣦⣤⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⣤⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⢀⣶⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⣠⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠛⠛⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠋⠉⠉⠁⠀⠀⠀⠀⠀⠀⠈⠙⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⢸⣿⣿⣿⣿⡿⠛⠛⠛⠉⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠘⢻⣿⣿⠏⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⣿⡟⠀⠀⠀⣀⠀⠀⠀⡐⠆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠿⠿⣿⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⣿⡇⢀⠄⠉⣀⡀⢉⠁⣠⣶⣶⣶⣶⣤⣀⣀⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠙⣿⣿⣿⣿⣿⣿⡿⢁⠔⠀⠀⠪⢂⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠹⡇⢀⣴⣿⡿⢀⠀⠀⠉⠛⠛⠛⠿⣿⣿⣿⣿⣿⣿⣦⠀⡀⠀⠀⠀⠀⠀⢹⣿⣿⣿⡿⠋⠀⠁⠀⠀⠀⠀⢻⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⢀⣼⣿⣿⠟⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣀⠀⠀⠀⢉⠡⢀⡀⠀⠀⠀⠀⠀⠸⣿⣿⡟⠀⠀⠀⠐⠂⠀⠀⡠⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⣾⣿⡿⠛⠐⠂⠤⡐⠄⠀⢠⠀⠀⠊⠶⠛⠛⠛⠊⠥⠄⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡀⠀⠀⠀⠇⢸⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⢹⡏⠀⣀⣴⠶⠶⢾⠰⠀⠀⠀⠀⠀⠠⠤⠄⠂⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡀⠘⠊⢸⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠣⡞⢟⠁⢀⠠⢘⡼⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠐⠁⠀⠀⢀⠆⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⡹⠂⠀⠀⡐⠁⠆⠀⠀⠀⠀⠀⠀⠀⠀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣠⠃⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⢠⠁⠀⠀⡌⠀⡘⠀⠀⠀⠀⠀⠀⠀⢱⠀⠀⠑⢄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠁⢸⡿⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠈⠀⠀⢰⠀⢈⢃⡀⠀⢠⠐⠀⠀⠀⠁⠀⠀⠀⠀⠑⠄⠀⠀⠀⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠀⣼⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠘⡀⠀⠀⠄⠀⠉⠁⠀⠀⠀⠀⣀⠠⠄⢀⣀⣤⣀⠀⠈⡄⡄⠀⢡⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⠀⣿⠇⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠐⡄⠀⡀⠀⢀⠤⠒⣈⣩⡤⢶⠞⠟⢙⠉⡋⣛⣿⡆⠀⡇⠀⡈⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠈⢄⠐⢄⠠⣿⣿⡋⡁⢁⣀⣤⣷⣾⣿⣿⣿⢿⠃⠀⡇⢠⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠈⠢⡀⠑⡜⢜⠻⣿⣿⡿⢻⣻⠹⠕⠋⢁⠊⠀⠀⠇⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠈⠢⠈⢄⠢⢀⣉⡁⠁⠀⠤⠐⠊⠀⠀⠀⠠⠰⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡠⠂⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠑⡈⠄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠔⢁⠁⠀⠀⠀⠀⠀⠀⠀⠀⢀⠔⠀⠀⠀⠠⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠃⠀⠀⠀⠀⠀⠘⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠐⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢣⢀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠐⢄⠀⠀⠀⠀⠀⢀⠠⠔⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⡄⠱⡀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡰⠫⡁⠒⢄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠹⡄⠈⠐⠠⡀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡔⠀⠀⢡⠀⠀⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡅⠀⠀⠀⠈⠰⡀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⠀⠀⠀⠀⠡⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠀⠀⠀⠀⠀⠀⠀


  • -4
    Anais  comentat a les des. 14, 2023, 1:58 p.m.

    miau


  • -13
    JouGhost  comentat a les oct. 25, 2023, 5:45 p.m.

    This comment is hidden due to too much negative feedback. Click here to view it.


  • -8
    chriwbrown  comentat a les oct. 24, 2023, 4:11 p.m.

    This comment is hidden due to too much negative feedback. Click here to view it.


  • -10
    AlanTeixido  comentat a les oct. 23, 2023, 5:22 p.m.

    This comment is hidden due to too much negative feedback. Click here to view it.


  • -3
    DeividRopi31  comentat a les oct. 20, 2023, 5:35 p.m.

    :)


  • -8
    ReyEspañol  comentat a les oct. 12, 2023, 1:33 p.m.

    This comment is hidden due to too much negative feedback. Click here to view it.


  • 4
    hector  comentat a les oct. 5, 2023, 6:38 p.m.

    miau guau


  • 5
    Sergio22  comentat a les set. 28, 2023, 4:54 p.m.

    I belong to Jesus


  • -23
    marc  comentat a les set. 25, 2020, 8:26 p.m.

    This comment is hidden due to too much negative feedback. Click here to view it.