SHARE
TWEET

CSLight_Name_Output_HW

Fox_McCloud77 Feb 14th, 2020 78 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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_Name_Output_HW
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             Console.OutputEncoding = Encoding.UTF8;
  14.  
  15.             string name = string.Empty;
  16.             int nameCount;
  17.             char symbol;
  18.  
  19.             Console.Write("Введите ваше имя: ");
  20.             name = Console.ReadLine();
  21.             Console.WriteLine($"\nДлина вашего имени: {name.Length}.\n");
  22.  
  23.             Console.Write("Введите символ: ");
  24.             symbol = Convert.ToChar(Console.ReadLine());
  25.  
  26.             Console.Clear();
  27.  
  28.             for (nameCount = -1; nameCount <= name.Length; nameCount++)
  29.                 Console.Write(symbol);
  30.  
  31.             Console.SetCursorPosition(0, 1);
  32.  
  33.             Console.Write($"{symbol}{name}{symbol}");
  34.  
  35.             Console.SetCursorPosition(0, 2);
  36.  
  37.             for (nameCount = -1; nameCount <= name.Length; nameCount++)
  38.                 Console.Write(symbol);
  39.  
  40.             Console.ReadKey();
  41.         }
  42.     }
  43. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top