Lysee 的打印输出
Lysee 写标准输出有以下三种方式:
1、使用输出操作符“=”:
调用格式: = v1, v2, ..., vn;
// 代码
= "\"RTFSC!\"", "stands for", "\"Read The F**king Source Code!\"";
// 输出
"RTFSC!" stands for "Read The F**ing Source Code!"
“=”输出时自动在逗号分隔的变量间加入一个空格。
2、使用sys::print()函数:
函数原型:public void sys::print(string Str)
// 代码
10.times {|int i| print(i + 1 + " ") };
// 输出
1 2 3 4 5 6 7 8 9 10
3、使用sys::println()函数:
函数原型:public void sys::println(string Str)
// 代码
10.times {|int i| println(i + 1 + " ") };
// 输出
1
2
3
4
5
6
7
8
9
10
看出println与print的区别没有?