-
-
Save MaximeD/1271170 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| array, places = [1,2,3,8,5,8,0,4], [] | |
| puts "Maximum value of array is #{array.max.to_s}" | |
| array.each_with_index do |val,i| | |
| places << i if val == array.max | |
| end | |
| puts "You can find #{array.max.to_s} in position #{places.join ', '}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ça c'est juste un fichier, hein :)
Mais t'inquiètes, je doute qu'on ait jamais quelque chose d'aussi gros à écrire que rails.