title: How can I calculate the number of ships in the battleship game
body: <p>Need to calculate the number of ships. Ships are presented as a “battleship” game.</p>
  <p>“1” represents a ship, “0” represents water. C#</p>
  <pre><code>namespace Ships
   {
   class Program
    {
    static int[,] ships = new int[10, 10] {
        { 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, },
        { 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, },
        { 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, },
        { 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, },
        { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, },
        { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
        { 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, },
        { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
        { 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, },
        { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, }
    };
  
    static void Main(string[] args)
    {
       int count = 0;
  
       // code write here
      
       Console.WriteLine(count);
  
       Console.ReadLine();
    }
   }
  }
  </code></pre>