Basic Pascal Tutorial/Chapter 2/Output/zh CN: what changed
Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.
Title: Basic Pascal Tutorial/Chapter 2/Output/zh CN
| Old | New | Line | |
|---|---|---|---|
| 1 | + | 2B - 输出 (原作者: Tao Yue, 状态: 已更改) | |
| 2 | + | ||
| 3 | + | 有2个语句可以实现在屏幕上显示数据,其中 `writeln` 语句已经在上一章节作业中用到: | |
| 4 | + | ||
| 5 | + | ``` pascal | |
| 6 | + | write (参数列表); | |
| 7 | + | writeln (参数列表); | |
| 8 | + | writeln; | |
| 9 | + | ``` | |
| 10 | + | ||
| 11 | + | 参数列表是一串用逗号分隔的常量、变量、函数名、表达式或字符串。如果是变量、函数名、表达式,则将其计算结果输出;如果是常量或字符串,则直接输出其值。 | |
| 12 | + | ||
| 13 | + | `write` 和 `writeln` 的区别在于:`write语句`是输出项输出后,不换行,光标停留在最后一项后,`writeln` 语句按项输出后,自动换行,光标则停留在下一行的开始位置。 | |
| 14 | + | ||
| 15 | + | `writeln` 语句允许不含有输出项,即仅writeln;表示换行。 | |
| 16 | + | ||
| 17 | + | ## 留意 | |
| 18 | + | ||
| 19 | + | 你要显示单引号,需要使用2个单引号;如果要显示2个单引号,你需要使用4个单引号来使用。 | |
| 20 | + | ||
| 21 | + | ## 注意 | |
| 22 | + | ||
| 23 | + | 在pascal中,字符是用单引号(')括起来的!这跟那些允许使用双引号或Heredoc符号的新语言不同。标准pascal并不允许使用双引号来标记字符或字符串。 | |
| 24 | + | ||
| 25 | + | | | | | | |
| 26 | + | |----|----|----| | |
| 27 | + | | [[Basic Pascal Tutorial/Chapter 2/Input/zh CN|上一页]] | [[Basic Pascal Tutorial/Contents/zh CN|目录]] | [[Basic Pascal Tutorial/Chapter 2/Formatting output/zh CN|下一页]] | | |
| 28 | + | ||
| 29 | + | --- | |
| 30 | + | *From the Free Pascal wiki, page "Basic Pascal Tutorial/Chapter 2/Output/zh CN", as it stood on 2022-08-20 after a change by Kai Burghardt, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).* |
