OUTPUT and sequence · 出力と順序
This page needs a recent browser (with SharedArrayBuffer support). Please update Chrome, Edge, Firefox or Safari to the latest version. · このページには最新のブラウザ(SharedArrayBuffer対応)が必要です。Chrome、Edge、Firefox、Safariを最新バージョンに更新してください。
English
Pseudocode is the exam's language
- Cambridge International AS Computer Science 9618 writes algorithms in pseudocode.
- Use the guide for exams in 2026. The guide for 2027, 2028 and 2029 uses the same syntax.
- Statements run from top to bottom. That order is sequence.
日本語
擬似言語は試験の言語
- Cambridge International AS Computer Science 9618では、アルゴリズムを擬似言語で記述する。
- 2026年の試験用ガイドを使用すること。2027, 2028, 2029年のガイドでも同じ構文が用いられる。
- 命令は上から下へ順に実行される。この順序は順次である。
OUTPUT "Wake up"
OUTPUT "Brush teeth"
OUTPUT "Go to school"
Explore · 探索
One line after another · 各行が順に実行される
Pseudocode runs top to bottom — each line after the one above it. · 擬似コードは上から下へ実行されます — 各行はその上の行の後に実行されます。
English
OUTPUT shows a value
OUTPUTdisplays a value. Text goes in double quotes.- Each
OUTPUTstarts a new line. - Several values, separated by commas, print on one line.
日本語
OUTPUTは値を表示する
- **
OUTPUT**は値を表示する。テキストは二重引用符で囲む。 - 各
OUTPUTは新しい行を開始する。 - 逗区で区切られた複数の値は、1行に印刷される。
OUTPUT "Hello, world!"
OUTPUT "You have ", 3, " lives left"
English
Watch out
- Keywords are capitals:
OUTPUT, notprint. - A comma keeps values on one line. A new
OUTPUTstarts the next line. - Joining two strings with
&is taught with the string functions.
日本語
注意
- キーワードは大文字:
OUTPUT、printではない。 - 逗区は値を1行に保つ。新しい
OUTPUTは次の行を開始する。 &で2つの文字列をつなぐことは、文字列関数を用いて教えられる。
English
Common mistakes
- Text needs quotes. A number does not:
OUTPUT 42. - Comments start with
//and run to the end of the line.
日本語
よくあるミス
- テキストには引用符が必要だが、数字には不要:
OUTPUT 42。 - コメントは
//から始まり、行の終わりに至ります。
English
Now you try
- Type pseudocode in the box, then press Run.
- Press Check answer to test it.
日本語
あなたも試してみよう
- 箱に擬似コードを入力し、実行を押してください。
- Check answer を押して確認する。
Use OUTPUT to print the word Hello. · OUTPUTを使用して文字列Helloを出力します。
Click Run to see the output here. · 実行ボタンをクリックして出力を確認してください。
Print Red, Green and Blue, one per line, in that order. · Red、Green、Blueを、その順序で1行ずつ出力します。
Click Run to see the output here. · 実行ボタンをクリックして出力を確認してください。
On one line, output You have , the number 3, then lives left. · 1行目にYou have 、数字3、そして lives leftを出力します。
Click Run to see the output here. · 実行ボタンをクリックして出力を確認してください。