OUTPUT and sequence · ĐẦU RA và thứ tự
This page needs a recent browser (with SharedArrayBuffer support). Please update Chrome, Edge, Firefox or Safari to the latest version. · Trang này cần trình duyệt gần đây (hỗ trợ SharedArrayBuffer). Vui lòng cập nhật Chrome, Edge, Firefox hoặc Safari lên phiên bản mới nhất.
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.
Tiếng Việt
Mã giả là ngôn ngữ của kỳ thi
- Cambridge International AS Tin học 9618 viết thuật toán bằng mã giả.
- Sử dụng hướng dẫn cho kỳ thi 2026. Hướng dẫn cho 2027, 2028 và 2029 sử dụng cùng cú pháp.
- Các lệnh chạy từ trên xuống dưới. Thứ tự đó gọi là trình tự.
OUTPUT "Wake up"
OUTPUT "Brush teeth"
OUTPUT "Go to school"
Explore · Khám phá
One line after another · Một dòng sau dòng khác
Pseudocode runs top to bottom — each line after the one above it. · Pseudocode chạy từ trên xuống dưới — mỗi dòng sau dòng ngay phía trên nó.
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.
Tiếng Việt
OUTPUT hiển thị giá trị
OUTPUThiển thị một giá trị. Văn bản đặt trong ngoặc kép đôi.- Mỗi
OUTPUTbắt đầu một dòng mới. - Nhiều giá trị, tách biệt bởi dấu phẩy, in trên một dòng.
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.
Tiếng Việt
Lưu ý
- Từ khóa viết hoa:
OUTPUT, không phảiprint. - Dấu phẩy giữ các giá trị trên một dòng. Một
OUTPUTmới bắt đầu dòng tiếp theo. - Nối hai chuỗi ký tự với
&được dạy cùng các hàm chuỗi.
English
Common mistakes
- Text needs quotes. A number does not:
OUTPUT 42. - Comments start with
//and run to the end of the line.
Tiếng Việt
Lỗi thường gặp
- Văn bản cần dấu ngoặc. Số thì không:
OUTPUT 42. - Nhận xét bắt đầu bằng
//và kéo dài đến cuối dòng.
English
Now you try
- Type pseudocode in the box, then press Run.
- Press Check answer to test it.
Tiếng Việt
Bây giờ bạn thử
- Gõ pseudocode vào ô, sau đó nhấn Chạy.
- Nhấn Kiểm tra đáp án để thử nghiệm.
Use OUTPUT to print the word Hello. · Sử dụng OUTPUT để in ra từ Hello.
Click Run to see the output here. · Nhấn Chạy để xem kết quả ở đây.
Print Red, Green and Blue, one per line, in that order. · In Red, Green và Blue, mỗi cái một dòng, theo thứ tự đó.
Click Run to see the output here. · Nhấn Chạy để xem kết quả ở đây.
On one line, output You have , the number 3, then lives left. · Trên một dòng, xuất ra You have , số 3, sau đó là lives left.
Click Run to see the output here. · Nhấn Chạy để xem kết quả ở đây.