Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/awk -f
- # Tema d'esame 07/02/2003 (www.labinf.polito.it/whitone/index.php?summ=SO)
- # Uso: cat numeri.txt | awk -f fattoriale.awk
- # 14/08/2012 - BNCRCR
- {
- fattoriale = 1
- for (i = $1; i >= 1; i--)
- fattoriale *= i
- print fattoriale
- }
- # == numeri.txt ==
- # 1
- # 3
- # 5
- # 0
- # 2
Advertisement
Add Comment
Please, Sign In to add comment