Advertisement
Guest User

Untitled

a guest
Oct 21st, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. using System;
  2.  
  3. namespace HelloApp
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. string userName;
  10. char borderSymbol;
  11.  
  12. Console.Write("Введите свое имя: ");
  13. userName = Console.ReadLine();
  14.  
  15. Console.Write("Введите один символ: ");
  16. borderSymbol = Convert.ToChar(Console.Read());
  17. Console.ReadLine();
  18.  
  19. Console.WriteLine();
  20.  
  21. string border = "";
  22. int boxWidth = userName.Length + 4;
  23.  
  24. for (int i = 0; i < boxWidth; i++)
  25. {
  26. border += borderSymbol;
  27. }
  28.  
  29. Console.WriteLine($"{border}\n\n" +
  30. $"{borderSymbol} {userName} {borderSymbol}\n\n" +
  31. $"{border}");
  32.  
  33. Console.ReadLine();
  34. }
  35. }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement