主页
C++
C++ 运算符优先级
demo_oper_precedence2
运行 ❯
×
更改方向
保存代码
更改主题
#include
using namespace std; int main() { int result1 = 10 - 2 + 5; // (10 - 2) + 5 = 13 int result2 = 10 - (2 + 5); // 10 - 7 = 3 cout << result1 << "\n"; cout << result2 << "\n"; return 0; }
13
3