kwest87

Untitled

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