W1thr

Домашка №11

Jan 30th, 2021 (edited)
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.82 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 Homework11
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             Console.Write("Введите свое имя:");
  14.             string name = Console.ReadLine();
  15.             int nameLength = name.Length;
  16.  
  17.             Console.Write("Введите символ для обводки:");
  18.             string symbol = Console.ReadLine();
  19.  
  20.             for (int i = 0; i < nameLength+2; i++)
  21.             {
  22.             Console.Write(symbol);
  23.             }
  24.             Console.WriteLine($"\n{symbol}{name}{symbol}");
  25.             for (int i = 0; i < nameLength + 2; i++)
  26.             {
  27.                 Console.Write(symbol);
  28.             }
  29.         }
  30.     }
  31. }
  32.  
Add Comment
Please, Sign In to add comment