如果/ Else语句,怎么说“什么也不做”或“继续”

|                                                                                                                       
已邀请:
        只是省略else :)))
if(condition)
{
   do_something();
}

//go on with your program
    
        是。不存在的“ 1”语句与空语句相同。 这是所有类似C的语言所共有的。     
        如果无事可做,则省略
else
if (some condition)
{
    do stuff
}
循环中使用
continue
来使该循环的其余部分短路,而
break
则用于尽早终止循环。     
        如果不放置else部分,并且满足if条件,则程序将继续执行其流程:
if (SomeCondition)
{
    // Do something if the condition is not met        
}

// continue executing
    

要回复问题请先登录注册