Hunt 3: Text and numbers
Text or number?
"3"is a STRING.3is an INTEGER. They act differently.- Join strings with
&. Turn a number into a string withNUM_TO_STR.
| Word | Meaning |
|---|---|
| data type | the kind of value: STRING, INTEGER, REAL, CHAR, BOOLEAN |
| convert | change the type of a value |
DECLARE Age : INTEGER
Age ← 3
OUTPUT "Age: " & NUM_TO_STR(Age)
ความยาก 2/5 · 140 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
Your pet is stuck! This program should output Kit is 3 years old. Find the bug and fix it.
คลิก Run เพื่อดูผลลัพธ์ที่นี่
ความยาก 2/5 · 140 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
Your pet is stuck! This program should output Good. Find the bug and fix it.
คลิก Run เพื่อดูผลลัพธ์ที่นี่
ความยาก 2/5 · 140 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
Your pet is stuck! This program should output K. Find the bug and fix it.
คลิก Run เพื่อดูผลลัพธ์ที่นี่
ความยาก 2/5 · 140 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
Your pet is stuck! This program should output 8. Find the bug and fix it. (The input is 4.)
คลิก Run เพื่อดูผลลัพธ์ที่นี่
ความยาก 3/5 · 200 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
Your pet is stuck! This program should output 7.5. Find the bug and fix it.
คลิก Run เพื่อดูผลลัพธ์ที่นี่