title: Traversing through vector does not work, returns more elements when trying to print it
body: <p>Sample input: <code>tokens = [&quot;2&quot;,&quot;1&quot;,&quot;+&quot;,&quot;3&quot;,&quot;*&quot;]</code><br />
  Sample output: <code>9</code><br />
  Here is the code:</p>
  <pre><code>class Solution {
  public:
      int evalRPN(vector&lt;string&gt;&amp; tokens) {
          stack&lt;int&gt; s1;
          for(size_t i = 0; i &lt; size(tokens); i++){
            if(tokens[i]!= &quot;+&quot;||tokens[i]!= &quot;-&quot;||tokens[i]!= &quot;*&quot;||tokens[i]!= &quot;/&quot;) {
                cout &lt;&lt; tokens[i]; //prints '21+'???
                s1.push(stoi(tokens[i]));
            }
            if(tokens[i]== &quot;+&quot;){
              int tmp1 = s1.top();
              s1.pop();
              int tmp2 = s1.top();
              s1.pop();
              int res = tmp1 + tmp2;
              s1.push(res);
            }
            if(tokens[i]== &quot;-&quot;){
              int tmp1 = s1.top();
              s1.pop();
              int tmp2 = s1.top();
              s1.pop();
              int res = tmp1 - tmp2;
              s1.push(res);
            }
            if(tokens[i]== &quot;*&quot;){
              int tmp1 = s1.top();
              s1.pop();
              int tmp2 = s1.top();
              s1.pop();
              int res = tmp1 * tmp2;
              s1.push(res);
            }
            if(tokens[i]== &quot;/&quot;){
              int tmp1 = s1.top();
              s1.pop();
              int tmp2 = s1.top();
              s1.pop();
              int res = tmp1 / tmp2;
              s1.push(res);
            }
          }
          int tmp = s1.top();
          return tmp;
      }
  };
  </code></pre>
  <p>As you can see in the first iteration of for loop(i=0) for some reason when I try to get the first element of vector (&quot;2&quot;) and perform operations with it it does not work because the program thinks that &quot;21+&quot; is the first element of vector.</p>