Advertisement
winone1208

zad 16

Jun 7th, 2013
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.28 KB | None | 0 0
  1. #!/bin/bash
  2. clear
  3.  
  4. echo '20 liczb z przedziału <30;60>'
  5. echo 'NOTA: Generowanie liczb może troche potrwać'
  6.  
  7. n=1
  8.  
  9. while [ $n -le 20 ]
  10. do
  11.  
  12.   x=$(( 30+(`od -An -N2 -i /dev/random` )%(60-30+1) ))
  13.   echo $x
  14.   s=$[s+x]
  15.   n=$[n+1]
  16. done
  17.  
  18. echo "Suma wygenerowanych liczb to: $s"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement