Basic Pascal Tutorial/Chapter 2/Output/zh CN
Sent here from Output/zh CN.
Deutsch · English · Français · Български · Русский · 中文(中国) · 日本語
2B - 输出 (原作者: Tao Yue, 状态: 已更改)
有2个语句可以实现在屏幕上显示数据,其中 writeln 语句已经在上一章节作业中用到:
write (????????????);
writeln (????????????);
writeln;参数列表是一串用逗号分隔的常量、变量、函数名、表达式或字符串。如果是变量、函数名、表达式,则将其计算结果输出;如果是常量或字符串,则直接输出其值。
write 和 writeln 的区别在于:write语句是输出项输出后,不换行,光标停留在最后一项后,writeln 语句按项输出后,自动换行,光标则停留在下一行的开始位置。
writeln 语句允许不含有输出项,即仅writeln;表示换行。
留意
你要显示单引号,需要使用2个单引号;如果要显示2个单引号,你需要使用4个单引号来使用。
注意
在pascal中,字符是用单引号(')括起来的!这跟那些允许使用双引号或Heredoc符号的新语言不同。标准pascal并不允许使用双引号来标记字符或字符串。
| 上一页 | 目录 | 下一页 |
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.
Edited on wiki.freepascal.org by 5 people, 2013–2022
From the official wiki's backup of 26 May 2024: who edited this page there, and when. Edits made there after that date were not recorded, and the earlier versions are not shown here; the main page says why.
| When | Who | What changed |
|---|---|---|
| Wangyouworld | Created page | |
| Wangyouworld | ||
| Swen | (minor) | |
| Wangyouworld | (minor) | |
| FTurtle | ||
| Trev | Fixed syntax highlighting; removed categories included in template (minor) | |
| Kai Burghardt | Kai Burghardt moved page Output/zh CN to Basic Pascal Tutorial/Chapter 2/Output/zh CN: tidy up main name space: create subpage hierarchy for basic Pascal tutorial [cf. [[Special: PermaLink/149778#C... (minor) | |
| Kai Burghardt | bypass redirects [cf. discussion] | |
| Kai Burghardt | fix previous edit (minor) | |
| Kai Burghardt | bypass language bar/categorization template redirect [cf. discussion] (minor) |
Talk about this page
Nobody has opened a bench for this page yet. Sign in to open one.
