Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
接受一个整数 n 基于 n,接受 n 个输入 例如:在运行时 n = 2 那么应该接受 2 个字符串类型的输入
例如:在运行时 n = 3 那么应该接受 3 个字符串类型的输入
array = [] n.times {array << gets.chomp}
n = gets.chomp.to_i array = [] array[n] = gets.chomp while (n -= 1) >= 0 # array will contain the inputs... # array.pop will return them in order of input