<分区>
我看到 and
关键字在 if
语句中被使用,就像 &&
运算符一样。
这些 (and
, &&
) 之间有什么区别吗?
#include <iostream>
using namespace std;
int main()
{
bool a = true;
bool b = true;
if(a==true and b==true) // if(a==true && b == true)
{
cout << "YES ";
}
return 0;
}