SaNik74

NameOutput

Feb 18th, 2023 (edited)
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.65 KB | None | 0 0
  1. internal class Program
  2. {
  3.     static void Main(string[] args)
  4.     {
  5.         string? name;
  6.         char symbol;
  7.         string? symbolLine = "";
  8.         string secondLine;
  9.  
  10.         Console.Write("Введите имя: ");
  11.         name = Console.ReadLine();
  12.         Console.Write("Введите символ: ");
  13.         symbol = Convert.ToChar(Console.Read());
  14.         secondLine = symbol + name + symbol;
  15.  
  16.         for(int i = 0; i < secondLine.Length; i++)
  17.         {
  18.             symbolLine += symbol;
  19.         }
  20.         Console.WriteLine(symbolLine);
  21.         Console.WriteLine(secondLine);
  22.         Console.WriteLine(symbolLine);
  23.     }
  24. }
  25.  
Advertisement
Add Comment
Please, Sign In to add comment