Skip to content

Commit f4af510

Browse files
committed
feat: update test case
1 parent 31fa4e6 commit f4af510

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed
Binary file not shown.

leetcode/array/evaluate_reverse_polish_notation.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* @Author: Chacha
33
* @Date: 2022-04-24 16:01:51
44
* @Last Modified by: Chacha
5-
* @Last Modified time: 2022-04-24 16:51:35
5+
* @Last Modified time: 2022-04-24 17:04:37
66
*/
77

88
/**
@@ -138,8 +138,11 @@ int Solution::evalRPN(vector<string> &tokens)
138138
int main(int argc, char const *argv[])
139139
{
140140
Solution s;
141-
vector<string> tokens = {'2', '1', '+', '3', '*'};
142-
vector<string> tokens1 = {'10', '6', '9', '3', '+', '-11', '*', '/', '*', '17', '+', '5', '+'};
141+
142+
string str[] = {"2", "1", "1", "3", "3"};
143+
string str1[] = {"10", "6", "9", "3", "+", "-11", "*", "/", "*", "17", "+", "5", "+"};
144+
vector<string> tokens(str, str + 5);
145+
vector<string> tokens1(str1, str1 + 13);
143146

144147
cout << "tokens = ['2', '1', '+', '3', '*'], 运算结果为: " << s.evalRPN(tokens) << endl;
145148
cout << "tokens = ['10', '6', '9', '3', '+', '-11', '*', '/', '*', '17', '+', '5', '+'], 运算结果为: " << s.evalRPN(tokens1) << endl;

0 commit comments

Comments
 (0)