title: Algorithm for summing large number of very large numbers (C++)
body: <p>I am trying to solve <a href="https://projecteuler.net/problem=13" rel="nofollow noreferrer">Problem 13 @ Project Euler</a> and I am looking for a good algorithm to do <em>addition</em> and output the answer for very large numbers. First, I convert the digits of the numbers to elements of a matrix(100 x 50). This is the algorithm I came up with:</p>
  
  <pre><code>unsigned long long int sum=0, carry_over=0;
  for(int j=49; j&gt;=0; j--)
  {
      for(int i=0; i&lt;100; i++)
          sum+=num[i][j];
      sum+=carry_over;
      carry_over=sum/10;
      cout&lt;&lt;sum%10;
      sum=0;
  }
  cout&lt;&lt;carry_over;  
  </code></pre>
  
  <p>Now, the output will have reversed digits, starting with the units place digit and ending up in the first digit of the sum. This is easily reversed, manually. </p>
  
  <p>I want to know if this is a good algorithm, considering accuracy and speed. Please suggest corrections to better it.</p>