Skip to content · ⁨ข้ามไปยังเนื้อหา⁩

How many halvings? · ⁨มีการแบ่งครึ่งกี่ครั้ง?⁩

English

How many halvings?

n starts at 40. Halve it with n = n // 2 until it reaches 0, counting the steps in steps.

// divides and throws the remainder away, so 5 // 2 is 2. Counting how many times a loop went round needs its own variable, going up by one each turn.

ไทย

แบ่งครึ่งกี่ครั้ง?

n เริ่มที่ 40. แบ่งครึ่งด้วย n = n // 2 จนกว่ามันจะถึง 0, นับขั้นตอนใน steps

// หารและทิ้งเศษออก, ดังนั้น 5 // 2 คือ 2. การนับ กี่ครั้ง ลูปวนรอบ ต้องมีตัวแปรของตัวเองเพิ่มขึ้นหนึ่งทุกรอบ

Log in or create account · ⁨เข้าสู่ระบบหรือสร้างบัญชี⁩

IGCSE, A-Level & AP