Advertisement
rukvir

HW 2_7_1

Apr 13th, 2022
990
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.07 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace HomeWorck_2_7_1
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             string userName;
  14.             string userSymbol;
  15.             string characters = "";
  16.  
  17.             int lefRightBoards = 2;
  18.             int userStringLength = 0;
  19.  
  20.             Console.WriteLine("Введите Ваше имя!");
  21.             userName = Console.ReadLine();
  22.             Console.WriteLine("Введите символ ограждение");
  23.             userSymbol = Console.ReadLine();
  24.  
  25.             userStringLength = lefRightBoards + lefRightBoards + userName.Length;
  26.  
  27.             for (int i = 1; i <= userStringLength; i += 1)
  28.             {
  29.                 characters += userSymbol;
  30.             }
  31.  
  32.             Console.WriteLine(characters);
  33.             Console.WriteLine(userSymbol + " " + userName + " " + userSymbol);
  34.             Console.WriteLine(characters);
  35.  
  36.             Console.ReadKey();
  37.         }
  38.     }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement