运算符 | 示例 | 结果 |
== | 2==1 | 0 |
!= | 2 !=1 | 1 |
< | 2 < 1 | 0 |
> | 2 > 1 | 1 |
<= | 2<=1 | 0 |
>= | 2>=1 | 1 |
#include <iostream>
#include <string>
using namespace std;
int main() {
int a= 10;
int b= 3;
cout <<"==:"<<(a==b)<< endl;
cout <<"!=:"<<(a!=b)<< endl;
cout <<"<:"<<(a<=b)<< endl;
cout <<">:"<<(a>=b)<< endl;
cout <<"<=:"<<(a<=b)<< endl;
cout <<">=:"<<(a>=b)<< endl;
return 0;
}