按位取反
This commit is contained in:
parent
7459ef21df
commit
30bd068d05
|
@ -0,0 +1,14 @@
|
|||
// 按位取反
|
||||
#include <iostream>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main()
|
||||
{
|
||||
int n = 10;
|
||||
cout << "~10 = " << ~n << endl; // 取反
|
||||
n = -9;
|
||||
cout << "~-9 = " << ~n << endl; // 取反
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue