源代码:
#!/usr/bin/ruby H = Hash["a" => 100, "b" => 200] puts "#{H['a']}" puts "#{H['b']}"
运行结果:
#!/usr/bin/ruby H = Hash["a" => 100, "b" => 200] puts "#{H['a']}" puts "#{H['b']}"