title: What is the problem with my add big number code?
body: <p>I searched everything I tried, but I couldn't find an answer I need.</p>
  <p>I was solving a problem called &quot;Big Number A+B&quot;, with C language. The maximum value of A and B is 10^10000 so I couldn't solve it with <code>unsigned long long</code>, so I tried using <code>char</code> array to add it.</p>
  <pre><code>#include &lt;stdio.h&gt;
  
  int main(void) {
      char tem1[10001], tem2[10001];
      char a[10001], b[10001], res[10002] = &quot;&quot;;
      int carry = 0, sum = 0;
  
      scanf(&quot;%s%s&quot;, tem1, tem2);
      sprintf(a, &quot;%010000s&quot;, tem1);
      sprintf(b, &quot;%010000s&quot;, tem2);
  
      for (int i = 9999; i &gt;= 0; i--) {
          sum = (a[i] - 48) + (b[i] - 48) + carry;
          carry = sum / 10;
          sum = sum % 10;
          res[i + 1] = sum + 48;
      }
      res[0] = carry + 48;
  
      int start = 0;
  
      while (res[start] == 48) {
          start++;
      }
  
      puts(res + start);
      return 0;
  }
  </code></pre>
  <p>I declared 5 <code>char</code> arrays, two for save number temporary, two for numbers for adding, but I put zeros at front to make length exactly 10000, and last for to save result.</p>
  <p>Because input was two integers at single line, I used <code>scanf</code> to read them. And whith <code>sprintf</code>, I put zeros to make length to 10000. Then inside <code>for</code> loop, I added <code>a[i]</code>, <code>b[i]</code>, and <code>carry</code>, and mod 10 to save char to array <code>res</code>. and after breaking out of the loop, I copied last carry to <code>res[0]</code>.</p>
  <p>Actual add is done, but there could be zeros at front of result, so I found where character wasn't '0', and printed it from there.</p>
  <p>I put numbers to this program, and everything worked fine. But when I submited this code to judge, it says <strong>Output Limit Exceeded</strong>, why does it?</p>
  <p>I'm sorry if my english was bad, or question was too stupid. Thank you.</p>