OUTPUT and sequence
此页面需较新浏览器(支持 SharedArrayBuffer)。请升级 Chrome、Edge、Firefox 或 Safari 至最新版本。
伪代码是考试的语言
- 剑桥 IGCSE 计算机科学 0478(2026、2027 与 2028 考纲)用伪代码(pseudocode)写算法 —— 不是 Python 或 Java。
- 它读起来就像一条条朴素的步骤,从上到下运行。这种顺序叫顺序结构(sequence)。
- 在下面,你可以真正运行自己写的伪代码。
English
OUTPUT "Wake up"
OUTPUT "Brush teeth"
OUTPUT "Go to school"
探索
One line after another
Pseudocode runs top to bottom — each line after the one above it. This order is 序列.
OUTPUT 显示文本
OUTPUT把一个值显示在屏幕上。- 文本放在双引号里:
"Hello"。 - 每个
OUTPUT另起一行。
English
OUTPUT "Hello, world!"
OUTPUT "IGCSE Computer Science"
OUTPUT 可以拼接多项
- 在
OUTPUT后面列出多项,用逗号隔开。 - 它们会并排打印,中间没有空隙。
English
OUTPUT "Total: ", 7 // → Total: 7
注意
- 文本必须加双引号;数字不用(
OUTPUT 7没问题)。 - 逗号把多项拼在一行;新的
OUTPUT另起一行。 Total: 7里冒号后的空格写在引号里面:OUTPUT "Total: ", 7。
常见错误
OUTPUT显示一个值;语句按书写顺序运行。- 使用考试的确切关键词(
OUTPUT,而不是print)。
现在轮到你
- 在框里输入伪代码,然后按 Run 看它的输出。
- 按检查答案来测试它。
难度 1/5 · 今日首次完成可获 100 金币及少量额外奖励
Use OUTPUT to print the word Hello.
点击“运行”查看此处输出。
难度 1/5 · 今日首次完成可获 100 金币及少量额外奖励
Print Red, Green and Blue, one per line, in that order.
点击“运行”查看此处输出。
难度 1/5 · 今日首次完成可获 100 金币及少量额外奖励
On one line, output Total: then a space then the number 7, so it reads Total: 7. The space after the colon belongs inside the quotes. Separate the two items with a comma.
点击“运行”查看此处输出。