title: Check if number is automorphic
body: <p>I'm getting two numbers. First natural number n and second n - digit number. n range is <code>1&lt;=n&lt;=50000</code>. The problem is how can I do <code>n * n</code> on big numbers with for example <code>49000</code> digits. I was trying to do it on string, then I have array with each digit but what then? Write function that multiply n * n as string? I didn't have idea how to start it. Any ideas?</p>
  
  <p>EDIT
  I check if number is <code>automorphic</code> but how to edit it to work with numbers to <code>50000</code> digits?</p>
  
  <pre><code>#include &lt;cstdlib&gt;
  #include &lt;iostream&gt;
  
  using namespace std;
  
  int main() {
      unsigned int n, m = 10, a, b;
  
      cin &gt;&gt; n;
  
      b = m;
      while (n &gt; b) {
          b *= m;
      }
  
      a = (n * n) % b;
  
      if (a == n)
          cout &lt;&lt; "OK";
      else
          cout &lt;&lt; "NO";
  
      return 0;
  }
  </code></pre>