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.
我想每个switch算法都可以被算法重写if...else if...else,那为什么我们还需要switch更多呢?代码效率有很大差异吗?
switch
if...else if...else
同样的问题也适用于for循环while算法。
for
while