title: Working with matrix using stl in c++
body: <p>Given a non-empty  array of numbers. Display the number of the most common in this array.   </p>
  
  <pre><code>#include &lt;iostream&gt;
      #include &lt;map&gt;
      #include &lt;algorithm&gt;
      #include &lt;clocale&gt;
      #include &lt;iterator&gt;
  
      int main()
      {
          setlocale(LC_ALL, "");
          const int size = 5;
          int array[size];
          for (int i = 0; i &lt; size; i++)
              std::cin &gt;&gt; array[i];
          std::map&lt;int, int&gt; map;
          for (int i = 0; i &lt; size; i++)
              map[array[i]] = std::count(std::begin(array), std::end(array), array[i]);
          std::cout&lt;&lt; "The most common element: " &lt;&lt; map.begin()-&gt;first &lt;&lt; std::endl;
          std::sort(std::begin(array), std::end(array));
          std::cout &lt;&lt; "Sorting array: \n";
          std::copy(std::begin(array), std::end(array), std::ostream_iterator&lt;int&gt;(std::cout, " "));
          std::cout&lt;&lt; std::endl;
  
      }
  </code></pre>
  
  <p>Can I rewrite such program in case two-dimensional array?
  And how i can it do?</p>