Skip to content

Palindrome · ⁨回文⁩

English

Palindrome

Return 1 if a C-string reads the same in both directions, otherwise 0 — in C there's no bool by default, so we use the integers 1 and 0. Compare characters from the two ends moving inward.

中文

回文

如果 C 字符串正反读相同就返回 1,否则返回 0 —— C 默认没有 bool 类型,所以我们用整数 1 和 0。从两端向中间逐个比较字符。

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

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