之前以为while( XX and YY)在做判断时是将括号内的XX 和YY分别做判断再 &&。
后来在leetCode发现例如:
while( he.top()==popped[j] and ! he.empty())
会报错:
但颠倒 and 前后顺序是可以的
while(! he.empty() and he.top()==popped[j])
之前以为while( XX and YY)在做判断时是将括号内的XX 和YY分别做判断再 &&。
后来在leetCode发现例如:
while( he.top()==popped[j] and ! he.empty())
会报错:
但颠倒 and 前后顺序是可以的
while(! he.empty() and he.top()==popped[j])