Advertisement
rukvir

HW 2_7_4

Mar 1st, 2025
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.94 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.             string userNameString = "";
  12.             string userSymbolString = "";
  13.  
  14.             Console.WriteLine("Введите символ для обводки имени?");
  15.             userSymbol = Console.ReadLine();
  16.             Console.WriteLine("Введите ваше имя");
  17.             userName = Console.ReadLine();
  18.             userNameString = $"{userSymbol}{userName}{userSymbol}";
  19.  
  20.             for (int i = 0; i < userNameString.Length; i++)
  21.             {
  22.                 userSymbolString += userSymbol;
  23.             }
  24.  
  25.             Console.WriteLine($"\n{userSymbolString}");
  26.             Console.WriteLine(userNameString);
  27.             Console.WriteLine(userSymbolString);
  28.  
  29.             Console.ReadKey();
  30.         }
  31.     }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement