Looking for ruby Answers? Try Ask4KnowledgeBase
Looking for ruby Keywords? Try Ask4Keywords

Ruby Language Lecture de STDIN


Exemple

# Get two numbers from STDIN, separated by a newline, and output the result
number1 = gets
number2 = gets
puts number1.to_i + number2.to_i
## run with: $ ruby a_plus_b.rb
## or:       $ echo -e "1\n2" | ruby a_plus_b.rb