Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def countHigher(ar, standard)
- n = 0
- for i in 0 .. ar.size - 1 do
- if ar[i] > standard then
- n += 1
- end
- end
- return n
- end
- ################# Main #################
- ar = [176.5,173.6,178.7,168.6,173.2,179.5,177.9,168.0,176.8,181.7,175.4,179.7,
- 170.4,171.0,166.7,177.4,175.9,174.7,170.3,173.2,177.1,178.7,174.3,172.9,
- 176.0,184.9,181.5,177.1,161.9,176.2,179.7,170.3,182.7,166.4,171.7,180.8,
- 181.3,182.4,172.8,172.9,180.9,189.9,179.2,184.2,170.2,185.3,173.9,183.3,
- 183.5]
- standard = 171.0
- higher = countHigher(ar,standard)
- print(standard , " cm higher " , higher , " person. ")
Advertisement
Add Comment
Please, Sign In to add comment