Advertisement
rukvir

HW 2_7_2

Feb 13th, 2025
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.95 KB | None | 0 0
  1. using System;
  2.  
  3. namespace HW_2025
  4. {
  5.     internal class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string userSymbol = "";
  10.             string userName = "";
  11.             int borderNameSymbol = 2;
  12.  
  13.             Console.WriteLine("Введите символ для обводки имени?");
  14.             userSymbol = Console.ReadLine();
  15.             Console.WriteLine("Введите ваше имя");
  16.             userName = Console.ReadLine();
  17.  
  18.             for (int i = 0; i < userName.Length + borderNameSymbol; i++)
  19.             {
  20.                 Console.Write(userSymbol);
  21.             }
  22.  
  23.             Console.Write($"\n{userSymbol}");
  24.             Console.Write(userName);
  25.             Console.WriteLine(userSymbol);
  26.  
  27.             for (int j = 0; j < userName.Length + borderNameSymbol; j++)
  28.             {
  29.                 Console.Write(userSymbol);
  30.             }
  31.             Console.ReadKey();
  32.         }
  33.     }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement