ruby
baozhiyao234
这个作者很懒,什么都没留下…
展开
-
Ruby范例2-控制语句
1.测试if语句定义: def testIf(count) if count>10 puts "is so big" else puts "is so small" end end输入:testIf(11)输出: is so big另外一种写法: puts "hello" if count>102.原创 2011-03-26 10:32:00 · 507 阅读 · 0 评论 -
Ruby范例1
1.JAVA里的输出函数是:System.out.println("Hello world"); Ruby的输出函数为:puts "HelloWorld"2.全局变量定义用$符号定义;实例变量用@符号定义原创 2011-03-25 10:53:00 · 577 阅读 · 0 评论