Skip to content

Instantly share code, notes, and snippets.

@VladimirYus
Created November 29, 2025 06:42
Show Gist options
  • Select an option

  • Save VladimirYus/af4078f49cd92178c2f229c6028098e4 to your computer and use it in GitHub Desktop.

Select an option

Save VladimirYus/af4078f49cd92178c2f229c6028098e4 to your computer and use it in GitHub Desktop.
NameOutput
using System;
namespace NameOutput
{
internal class Program
{
static void Main(string[] args)
{
string userName;
char simbolForRectangle;
int lenghtName;
Console.WriteLine("Введите свое имя.");
userName = Console.ReadLine();
lenghtName = userName.Length;
Console.Write("Введите желаемый символ для вывода имени в прямоугольнике из символов: ");
simbolForRectangle = Convert.ToChar(Console.ReadLine());
for (int i = 0; i < lenghtName + 2; i++)
{
Console.Write(simbolForRectangle);
}
Console.WriteLine();
Console.WriteLine(simbolForRectangle + userName + simbolForRectangle);
for (int i = 0; i < lenghtName + 2; i++)
{
Console.Write(simbolForRectangle);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment