Sininerebane

Untitled

Sep 9th, 2023
1,114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.80 KB | Software | 0 0
  1. namespace TriangleSymbol
  2. {
  3.     internal class Program
  4.     {
  5.         static void Main(string[] args)
  6.         {
  7.             Console.OutputEncoding = Encoding.UTF8;
  8.  
  9.             char symbol;
  10.             string name;
  11.             int lineLegth;
  12.            
  13.             Console.WriteLine("Введите свое имя");
  14.             name = Console.ReadLine();
  15.  
  16.             lineLegth = (name.Length) + 2;
  17.             symbol = '%';
  18.  
  19.             for (int i=0; i < lineLegth; i++)
  20.             {
  21.                 Console.Write(symbol);;
  22.             }
  23.          
  24.             Console.WriteLine("\n" + symbol + name + symbol);
  25.  
  26.             for (int i = 0; i < lineLegth; i++)
  27.             {
  28.                 Console.Write(symbol);
  29.             }
  30. ;
  31.             Console.ReadKey();
  32.  
  33.         }
  34.     }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment