+、-的优先级大于移位运算的优先级,如下所示: #include<iostream> using namespace std; int main() { int temp=5; cout<<"2+temp>>1的值为"<<(2+temp>>1)<<endl; cout<<"2+(temp>>1)的值为"<<2+(temp>>1)<<endl; return 0; } 输出结果如下: