qfedu-basic-level/day6/d1.cpp

15 lines
209 B
C++
Raw Permalink Normal View History

2023-06-19 11:45:43 +08:00
// 按位取反
#include <iostream>
using namespace std;
int main()
{
int n = 10;
cout << "~10 = " << ~n << endl; // 取反
n = -9;
cout << "~-9 = " << ~n << endl; // 取反
return 0;
}