class Song
def initialize(name,artist,duration)
@name = name
@artist = artist
@duration = duration
end
def to_s
"Song : #{@name}--#{@artist} (#{@duration})"
end
end
class SongList
def initialize
@songs = Array.new
end
def append(aSong)
@songs.push(aSong)
...
def sayGoodnight(name)
#result = "Goodnight #{name}"
result = "Goodnight, " + name
return result
end
puts (sayGoodnight ("john-bo"))
Goodnight, john-bo
執行成功
puts sayGoodnight ("john-bo")
Goodnight, john-bo
warning: don't put space before argument parentheses
puts sayGoodnight "john-bo ...
- 浏览: 37427 次
- 性别:

- 来自: 珠海

- 详细资料
搜索本博客
我的相册
白水寨..亲瀑台
共 1 张
共 1 张
最近加入圈子
链接
最新评论
-
新生活..成功应征入伍.
我们那里当兵要走后门的 羡慕中...
-- by zhangzhaofeng -
又一届征兵的所想.
说到当兵的 经常遇到这样的人在qq找友里面发这样的信息 “我是军人,希望。。。。 ...
-- by linyuran -
新生活..成功应征入伍.
看了这个,真的有点感慨万千的感觉。 我一直都想去当兵,磨练自己,过过军旅生活。 ...
-- by foxty -
又一届征兵的所想.
强顶 拥军拥属 很多同学都是当兵地, ...
-- by giscat -
又一届征兵的所想.
指尖沙 写道 只想说,征兵也是有黑幕的 不合格的兵,到了部队也是有的受啊。。 ...
-- by YuLimin






评论排行榜