掃碼下載編程獅APP
#!/usr/bin/ruby # -*- coding: UTF-8 -*- def sample (*test) puts "參數(shù)個(gè)數(shù)為 #{test.length}" for i in 0...test.length puts "參數(shù)值為 #{test[i]}" end end sample "Zara", "6", "F" sample "Mac", "36", "M", "MCA"