Skip to content

Instantly share code, notes, and snippets.

@giancorzo
Created June 4, 2016 01:42
Show Gist options
  • Save giancorzo/67ed725d924445b19738ae77fbb411c6 to your computer and use it in GitHub Desktop.
Save giancorzo/67ed725d924445b19738ae77fbb411c6 to your computer and use it in GitHub Desktop.
#nota1 = 13
#nota2 = 15
#nota3 = 20
#nota4 = 4
#nota5 = 8
notas = [13,15,20,4,8]
#for i in 0...notas.length
# puts 1 + notas[i]
#end
#i = 0
#while i < notas.length
# puts notas[i]
# i += 1
#end
# notas.each_with_index { |nota, i|
# puts "#{i} #{nota}"
# }
# nota_mas_uno = notas.map { |nota| 1 + nota}
# puts nota_mas_uno
#p notas.select { |nota| nota < 10 }.reduce(:+)
#p notas
mayor = 21
for i in 0...notas.length
if (notas[i] < mayor)
mayor = notas[i]
end
end
puts mayor
p notas.sort.last
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment