title: Error : std:: out of range. where is out of range problem?
body: <p>Given the following code :</p>
  <pre><code>
  #include &lt;iostream&gt;
  #include &lt;vector&gt;
  
  using namespace std;
  
  int main() {
      
      int n;
      cin &gt;&gt; n;
      
      vector&lt;int&gt; v;
      v.emplace_back(1);
      v.emplace_back(2);
      
      for(int i = 2; i &lt; n; i++){ // Is this problem point?
          int data = v.at(i-1) + v.at(i-2);
          v.emplace_back(data);
      }
      
      cout &lt;&lt; v.at(n);
      
      return 0;
  }
  
  </code></pre>
  <p>this code has Error that is out of range.
  I think that for loop has problem.
  but I'm not sure where is out of range.
  Is vector container index starting 0?</p>