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。当 n 同时能被 3 和 4 整除时打印 yes,否则打印 no。

闰年判断就是用这个形状搭起来的:一个求余数的判断、== 0,再用 and 把两个连起来。每一边都要是完整的判断 —— n % 3 == 0 and n % 4 == 0。

Log in or create account · ⁨登录或创建账户⁩

IGCSE, A-Level · ⁨IGCSE、A-Level⁩ & AP · ⁨与 AP⁩