我已经看到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;
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3092 次 |
| 最近记录: |