Programming Basics
Моля за малко помощ!Показва ми грешка на 28 -ми ред.
using System;
namespace ChristmasSock
{
class ChristmasSock
{
static void Main()
{
int n = int.Parse(Console.ReadLine());
int height = 3 * n + 3;
Console.WriteLine("|{0}|", new string('-', n * 2));
Console.WriteLine("|{0}|", new string('*', n * 2));
Console.WriteLine("|{0}|", new string('-', n * 2));
for (int i = 0; i < n - 1; i++)
{
Console.WriteLine("|{0}{1}{0}|", new string('-', n - 1 - i), new string('~', 2 + i * 2));
}
for (int i = n - 2; i > 0; i--)
{
Console.WriteLine("|{0}{1}{0}|", new string('-', n - i), new string('~', i * 2));
}
for (int i = 0; i < n + 3 - 1; i++)
{
if (i == n / 2)
{
Console.WriteLine("{0}\\{1}MERRY}{1}\\", new string('-', n - 2), new string('.', n - 2));
}
else if (i == n / 2 + 2)
{
Console.WriteLine("{0}\\{1}X-MAS{1}\\", new string('-', n - 2), new string('.', n - 2));
}
else
{
Console.WriteLine("{0}\\{1}\\", new string('-', i), new string('.', 2 * n + 1));
}
Console.WriteLine("{0}\\{1})" , new string('-', n + 2), new string('_'), 3 * n + 1);
}
}
}
}
Това е условието: https://judge.softuni.bg/Contests/888/Programming-Basics-Exam-17-December-2017
Christmas Sock
Благодаря предварително!
Благодаря!