Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否可以在if 语句中编写双重不等式?
前任:if (x <= y <= z) do stuff;
if (x <= y <= z) do stuff;
不——Objective-C 是 C 语言的超集,并且使用与 C 相同的语法用于if语句。您必须将其分成两个不等式:if (x <= y && y <= z).
if
if (x <= y && y <= z)