Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for (int i = 0; i < ansNums.size(); i++) {
- if (i <= operators.size()) {
- if (operators[i] == "+") {
- out += ansNums[i];
- } else if (operators[i] == "-") {
- out -= ansNums[i];
- }
- } else {
- if (operators[i-1] == "+") {
- out += ansNums[i];
- } else if (operators[i-1] == "-") {
- out -= ansNums[i];
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement