Подскажите пожалуйста как изменить условие - C#
Формулировка задачи:
надо изменить условие, что-бы вместо одного ряда звездочек было два. помогите пожалуйста, один ряд смог сделать, два понят не могу как
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication8
{
using C = System.Console;
class Program
{
delegate bool Predicate(int x, int c);
static void Main()
{
Console.Write("Ввести x: ");
int MaxX = int.Parse(Console.ReadLine());
Console.Write("Ввести y: ");
int MaxY = int.Parse(Console.ReadLine());
for (int x = 0; x < MaxY; x++)
{
for (int y = 0; y < MaxX; y++)
{
if (x == MaxX/2 || y==MaxY/2)
C.Write('*');
else
C.Write(" ");
}
C.WriteLine();
}
C.ReadKey();
}
}
}Решение задачи: «Подскажите пожалуйста как изменить условие»
textual
Листинг программы
for (int x = 0; x < MaxY; x++)
{
if (x == MaxX / 2 || x == MaxX / 2 - 1)
C.WriteLine(new string('*', MaxX));
else
C.WriteLine("*".PadLeft(MaxX / 2) + "*");
}