MCPcopy Create free account
hub / github.com/EricPengShuai/Interview / priority

Function priority

practice/calExp.cpp:11–19  ·  view source on GitHub ↗

判断运算符的优先级

Source from the content-addressed store, hash-verified

9
10// 判断运算符的优先级
11int priority(char c) {
12 if (c == '+' || c == '-') {
13 return 1;
14 } else if (c == '*' || c == '/') {
15 return 2;
16 } else {
17 return 3; // 括号优先级最大
18 }
19}
20
21string reversePolarExp(string &s) {
22 string res;

Callers 1

reversePolarExpFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected