def sequence(n, m, c)
i = 0
while(i<0)
yield m * i + c
i += 1
end
end
sequence(3,5,1) {|y| puts y}
结果是 1 6 11
如果我把方法中 yield 删除,程序也运行顺利,求解?
def sequence(n, m, c)
i = 0
while(i<0)
m * i + c
i += 1
end
end
sequence(3,5,1) {|y| puts y}
结果是 1 6 11