Created
November 29, 2025 06:42
-
-
Save VladimirYus/af4078f49cd92178c2f229c6028098e4 to your computer and use it in GitHub Desktop.
NameOutput
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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