Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Name
- {
- class Program
- {
- static void Main(string[] args)
- {
- string name;
- char frameSymbol;
- string horizontalLine = "";
- int stringWidth;
- string formattedName;
- Console.Write("Введите имя: ");
- name = Console.ReadLine();
- Console.Write("Символ для рамки: ");
- frameSymbol = Convert.ToChar(Console.ReadLine());
- formattedName = $"{frameSymbol} {name} {frameSymbol}";
- stringWidth = formattedName.Length;
- for (int i = 0; i < stringWidth; i++)
- {
- horizontalLine += frameSymbol;
- }
- Console.WriteLine(horizontalLine);
- Console.WriteLine(formattedName);
- Console.WriteLine(horizontalLine);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement