#include<iostream>
#include<stdio.h>
using namespace std;
int main(){
int a = ~0 >> 1;
cout << a << endl;
}
输出结果: -1;
#include<iostream>
#include<stdio.h>
using namespace std;
int main(){
int a = (-2)>> 1;
cout << a << endl;
}
输出结果:-1;
采用的编译器为Microsoft Visual C++ 2013,默认逻辑右移。
rep(i, 5) dist[i] = 0x7fffffff;
dist<span style="white-space:pre"> </span>0x00f5ffb8{2147483647, 2147483647, 2147483647, 2147483647, 2147483647, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...}<span style="white-space:pre"> </span>int[105]
</