简单教程
提交运行
代码编辑器:
# !/usr/bin/ruby -w # -*- encoding:utf-8 -*- # filename: main.rb # author: 简单教程(www.twle.cn) # Copyright © 2015-2065 www.twle.cn. All rights reserved. def hello( *names ) print "Hello " for name in names print name, " " end puts "\nnames length is :#{names.length}" end hello "Baidu", "Twle", "NetEase", "Sina", "Ali", "Tencent" puts "" hello "Python", "Ruby", "Perl", "Scala", "JavaScript"
运行结果: