Jak ustawić kolory, aby linie nieparzyste były niebieskie

0

Witam,

Proszę o pomoc z poniższym zadaniem
titletitle

Zrobiłem mniej niż połowę, proszę o informację jak ustawić kolory o których mowa w zadaniu oraz aby wiersze składały się z dwóch wprowadzanych znaków.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace test
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Podaj wysokość: ");
int wysokosc;
wysokosc = Convert.ToInt32(Console.ReadLine());
int a = wysokosc;
Console.WriteLine("Podaj pierwszy znak: ");
string b;
b = (Console.ReadLine());
Console.WriteLine("Podaj drugi znak: ");
string c;
c = (Console.ReadLine());

        for (int o = 1; o < a; o++)
        {
            Console.Write("=");
        }
        Console.WriteLine("=");
        for (int i = wysokosc; i <= 0; i--)
        {

        }

        for (int i = wysokosc; i > 0; i--)
        {
            Console.Write("!");

            for (int j = i + 1; j > 1; j--)
            {
                Console.Write("&");
            }

            for (int k = 0; k < (wysokosc - i); k++)
            {

                Console.Write(" ");
            }

            Console.WriteLine("!");

        }

        for (int o = 0; o < a; o++)
        {
            Console.Write("=");
        }

        Console.ReadKey();

    }
}
}
0

Popraw proszę sekcję z wprowadzonym kodem i ustaw składnię jako C#.

1

Lubie takie posty na forum :D czy tylko mnie się wydaje, że te zdania na studiach są niemiłosiernie durne? Też tak mieliście?
Przerób sobie pod siebie

            int hight = 5;
            string firstChar = "#";
            string secondChar = "^";
  
            for(int k = hight; k > 0;)
            {
                string row = string.Empty;
                for (int i = 1; i <= hight; i++)
                {
                    if (i % 2 == 0)
                    {
                        row += secondChar;
                    }
                    else
                    {
                        row += firstChar;
                    }
                }
                k--;
                hight--;

                if(row.Length % 2 == 0)
                {
                    Console.ForegroundColor = ConsoleColor.Red;
                    Console.WriteLine(row);
                }
                else
                {
                    Console.ForegroundColor = ConsoleColor.Blue;
                    Console.WriteLine(row);
                }
            }

            Console.ReadLine();

1 użytkowników online, w tym zalogowanych: 0, gości: 1