Anonymous Anonymous - 17 days ago
300 0

No description

C#

gfssgfsg

static void Main(string[] args)
        {
            string[,] array = new string[10, 20];

            for (int i = 0; i < array.GetLength(0); i++)
            {
                for (int y = 0; y < array.GetLength(1); y++)
                {
                    int remainder = 0;
                    if (i % 2 != 0)
                        remainder = 1;
                    if(y % 2 == remainder)
                    {
                        array[i, y] = "x";
                    }
                    else
                    {
                        array[i, y] = "o";
                    }
                }
            }

            for (int i = 0; i < array.GetLength(0); i++)
            {
                for (int y = 0; y < array.GetLength(1); y++)
                {
                    Console.Write(array[i,y]);
                }
                Console.WriteLine();
            }

            Console.ReadKey();
        }