rukvir

HW 2_7_3

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