Advertisement
Guest User

Untitled

a guest
Apr 1st, 2020
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. using System;
  2.  
  3. namespace NameWithSymbol
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. string userName;
  10. char userSymbol;
  11. int amountSymbolInLine;
  12.  
  13. Console.Write("Введите ваше имя: ");
  14. userName = Console.ReadLine();
  15. Console.Write("Введите любой символ на вешей клавиатуре: ");
  16. userSymbol = Convert.ToChar(Console.ReadLine());
  17. amountSymbolInLine = userName.Length + 4;
  18. for (int i = 0; i <= amountSymbolInLine*3-userName.Length+2; i++ )
  19. {
  20. if (i == amountSymbolInLine || i == amountSymbolInLine*2-2)
  21. {
  22. Console.WriteLine("");
  23. }
  24. else if (i == amountSymbolInLine + 3)
  25. {
  26. Console.Write(userName);
  27. }
  28. else if (i >= 0)
  29. {
  30. Console.Write(userSymbol);
  31. }
  32. }
  33. }
  34. }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement