15 lines
209 B
C++
15 lines
209 B
C++
|
// 按位取反
|
||
|
#include <iostream>
|
||
|
|
||
|
using namespace std;
|
||
|
|
||
|
int main()
|
||
|
{
|
||
|
int n = 10;
|
||
|
cout << "~10 = " << ~n << endl; // 取反
|
||
|
n = -9;
|
||
|
cout << "~-9 = " << ~n << endl; // 取反
|
||
|
|
||
|
return 0;
|
||
|
}
|