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

Divisible by both · ⁨หารด้วยทั้งสองลงตัว⁩

English

Divisible by both

n is 12. Print yes when n divides exactly by both 3 and 4, and no otherwise.

This is the shape a leap-year test is built from: a remainder question, == 0, and and between two of them. Each side must be a whole question — n % 3 == 0 and n % 4 == 0.

ไทย

หารด้วยสองจำนวนได้พอดี

n คือ 12. ให้พิมพ์ yes เมื่อ n หารด้วย ทั้ง 3 และ 4 ลงตัว และพิมพ์ no ในกรณีอื่น ๆ

นี่คือโครงสร้างของการเขียนเงื่อนไขปี(files year): คำถามเกี่ยวกับเศษเหลือ, ตัวแปร == 0, และการเชื่อมด้วย AND/OR (and) ระหว่างสองส่วน โดยแต่ละด้านต้องเป็นคำถามที่สมบูรณ์ — เช่น n % 3 == 0 and n % 4 == 0

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

IGCSE, A-Level & AP