Or and not equal

前端 未结 6 682
忘掉有多难
忘掉有多难 2021-01-24 20:23

Why does this work?

#include 
#include 
using namespace std;
int main(){
string s=\"a\";
if((s==\"cm\")||(s==\"in\")||(s==\"ft\")||         


        
6条回答
  •  生来不讨喜
    2021-01-24 21:04

    (s!="cm")||(s!="in")||(s!="ft")||(s!="m")
    

    Each and everyone of those is true, so clearly the expression is true.

提交回复
热议问题