求教
ruby吧
全部回复
仅看楼主
level 1
cxq14100360 楼主
请问ruby中gets.chomp()和ARGV怎么结合使用,一直想不通
first,second,third = ARGV
puts “The script is called: #{$0}”
puts "he is #{first} years old."
puts "he is #{second} tall."
puts "he is #{third} heavy."
在这个里面怎么加入gets.chomp()用法?
雪地里跪求!!!!!!!!!!!!!!!
2012年09月27日 13点09分 1
level 8
ARGV.each { |a| puts a.chomp}
2012年09月29日 01点09分 2
level 9
ARGV 是命令行参数
gets 等待输入。
2012年09月29日 06点09分 3
1