zhangsongcui

Test

Jan 4th, 2012
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.23 KB | None | 0 0
  1. count=10
  2. right=0
  3. while test $count -ne 1
  4. do
  5.   ((a=$RANDOM%30))
  6.   ((b=$RANDOM%30))
  7.   ((c=a+b))
  8.   read -p "$a+$b=" r
  9.   test $c -eq $r && echo "Right";((right=right+1)) || echo "Wrong"
  10.   ((count=count-1))
  11. done
  12. echo "Right: $right"
Advertisement
Add Comment
Please, Sign In to add comment