title: Debug C++ code (add two very big numbers)
body: <p>This code is supposed to get two very big numbers and add them together. Just iostream and string library allowed.</p>
  <p>Example input:</p>
  <pre><code>132163162986831298132869132968213689316298613298681329689312682136312621382931628613286831286921968312698312698132682136893162986832168312698132
  8312961362983126893162986312986832196893126813268932169831268912869621386893126893126891326831268361298621398631286831269813268312698132689312683612986892136813268312698312698321686312986312986893216831268921368321698132689312698132689321683126893216986893216893126813268931286931629886312
  </code></pre>
  <p>Example output:</p>
  <pre><code>8312961362983126893162986312986832196893126813268932169831268912869621386893126893126891326831268361298621398631286831269813268312698132689312683745150055123644566445567445666535375629284926285574546520581603504634319515620941311419520608605095205915299591349575263706431918119099942584444
  </code></pre>
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  
  using namespace std;
  
  int main (){
      string num1 , num2 ,sum;
      getline(cin,num1);
      getline(cin,num2);
      if (num2.length() &gt; num1.length())
      {
          num2.swap(num1);
      }
      std::reverse(num1.begin(), num1.end());
      std::reverse(num2.begin(), num2.end());
      while(num2.length() &lt; num1.length())
          num2.push_back('0');
      size_t lnth = num1.length();
      unsigned tmp , holder=0;
      for (size_t i = 0;i &lt; lnth ; i++){
          tmp = (num1[i] - '0') + (num2[i] - '0') + holder;
          sum.push_back(tmp % 10 + '0');
          holder = tmp / 10;
      }
      if(holder &gt; 0){
          sum.push_back('0' + holder);
      }
      while(!sum.empty()){
          if (sum[sum.length() - 1] == '0'){
              sum.pop_back();
          }
          else{
              break;
          }
      }
      std::reverse(sum.begin(), sum.end());
      cout &lt;&lt; sum;
  }
  </code></pre>
  <p>I' getting some correct and some wrong answers;</p>