title: Project Euler 16 2^1000 i got 1319?
body: <p>i checked the answer and it's not off by much from my answer, but it is still an error. can someone check my coding to see what mistake caused me to get a value of 1319? </p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;vector&gt;
  using namespace std;
  
  int main()
  {
  int k = 0;
  int o = 0;
  vector&lt;int&gt; n(1,0);
  n[0] = 1;
  while (k &lt; 1001)
  {
      for (int l = 0; l &lt; n.size(); l++)
          n[l] = n[l] * 2;
      for (int l = 0; l &lt; n.size(); l++)
      {
          if (n[l] &gt;= 1000000)
          {
              int m;
              if (l == n.size() - 1)
                  n.resize(n.size() + 1);
              m = n[l] / 1000000;
              n[l] = n[l] % 1000000;
              n[l+1] = n[l+1] + m;
          }
      }
      k++;
  }
  for (int l = 0; l &lt; n.size(); l++)
      o = o + int (n[l]/1000000) + int ((n[l] % 1000000) / 100000) + int ((n[l] % 100000) / 10000) + int ((n[l] % 10000) / 1000) + int ((n[l] % 1000) / 100) + int ((n[l] % 100) / 10) + n[l] % 10;
  cout &lt;&lt; o;
  cin &gt;&gt; k;
  return 0;
  </code></pre>
  
  <p>}</p>