diff --git a/day6/d1.cpp b/day6/d1.cpp new file mode 100644 index 0000000..cb751b5 --- /dev/null +++ b/day6/d1.cpp @@ -0,0 +1,14 @@ +// 按位取反 +#include + +using namespace std; + +int main() +{ + int n = 10; + cout << "~10 = " << ~n << endl; // 取反 + n = -9; + cout << "~-9 = " << ~n << endl; // 取反 + + return 0; +}