Advertisement
Garloon

2.5

Aug 24th, 2019
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.16 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace CSLight
  8. {
  9.     class Menu
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             string name;
  14.             char symbol;
  15.  
  16.             Console.Write("Введите свое имя: ");
  17.             name = Console.ReadLine();
  18.  
  19.             Console.WriteLine("");
  20.             Console.Write("Введите желаемый символ: ");
  21.             symbol = Convert.ToChar(Console.ReadLine());
  22.  
  23.             int posX_1 = 0;
  24.             int symCount = name.Length + 2;
  25.  
  26.             while(posX_1 < symCount)
  27.             {
  28.                 Console.SetCursorPosition(posX_1, 5);
  29.                 Console.Write(symbol);
  30.                 posX_1++;
  31.             }
  32.  
  33.             Console.WriteLine();
  34.             Console.WriteLine(symbol + name + symbol);
  35.  
  36.             int posX_2 = 0;
  37.  
  38.             while (posX_2 < symCount)
  39.             {
  40.                 Console.SetCursorPosition(posX_2, 7);
  41.                 Console.Write(symbol);
  42.                 posX_2++;
  43.             }
  44.             Console.WriteLine();
  45.         }
  46.     }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement