Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace HomeWork
- {
- internal class Program
- {
- public static void Main(string[] args)
- {
- Console.Write("Введите символ для рамки: ");
- char borderChar = Console.ReadKey().KeyChar;
- Console.WriteLine();
- Console.Write("Введите имя: ");
- string name = Console.ReadLine();
- string nameLine = $"{borderChar}{name}{borderChar}";
- int frameWidth = nameLine.Length;
- string borderLine = new string(borderChar, frameWidth);
- Console.WriteLine(borderLine);
- Console.WriteLine(nameLine);
- Console.WriteLine(borderLine);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement