Advertisement
winone1208

zad 14

Jun 7th, 2013
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.21 KB | None | 0 0
  1. #!/bin/bash
  2. clear
  3.  
  4. echo 'Wpisz liczbe'
  5. read a
  6.  
  7. z=1
  8. x=1
  9.  
  10. while [ $a -gt 0 ]
  11. do
  12.  
  13.   x=$[z*x]
  14.   z=$[z+1]
  15.   s=$[s+x]
  16.   a=$[a-1]
  17.  
  18. done
  19.  
  20. echo "Wartość silni: $x"
  21. echo "Wartość sumy silni: $s"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement