按位取反

This commit is contained in:
flykhan 2023-06-19 11:45:43 +08:00
parent 7459ef21df
commit 30bd068d05
1 changed files with 14 additions and 0 deletions

14
day6/d1.cpp Normal file
View File

@ -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;
}