Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace CSLight_Name_Output_HW
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.OutputEncoding = Encoding.UTF8;
- string name = string.Empty;
- int nameCount;
- char symbol;
- Console.Write("Введите ваше имя: ");
- name = Console.ReadLine();
- Console.WriteLine($"\nДлина вашего имени: {name.Length}.\n");
- Console.Write("Введите символ: ");
- symbol = Convert.ToChar(Console.ReadLine());
- Console.Clear();
- for (nameCount = -1; nameCount <= name.Length; nameCount++)
- Console.Write(symbol);
- Console.SetCursorPosition(0, 1);
- Console.Write($"{symbol}{name}{symbol}");
- Console.SetCursorPosition(0, 2);
- for (nameCount = -1; nameCount <= name.Length; nameCount++)
- Console.Write(symbol);
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement