Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace NameWithSymbol
- {
- class Program
- {
- static void Main(string[] args)
- {
- string userName;
- char userSymbol;
- int amountSymbolInLine;
- Console.Write("Введите ваше имя: ");
- userName = Console.ReadLine();
- Console.Write("Введите любой символ на вешей клавиатуре: ");
- userSymbol = Convert.ToChar(Console.ReadLine());
- amountSymbolInLine = userName.Length + 4;
- for (int i = 0; i <= amountSymbolInLine*3-userName.Length+2; i++ )
- {
- if (i == amountSymbolInLine || i == amountSymbolInLine*2-2)
- {
- Console.WriteLine("");
- }
- else if (i == amountSymbolInLine + 3)
- {
- Console.Write(userName);
- }
- else if (i >= 0)
- {
- Console.Write(userSymbol);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement