Advertisement
Anonim_999

Untitled

Dec 12th, 2020 (edited)
660
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.03 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 ConsoleApp5
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             string frameLine = "";
  14.             Console.Write("Введите свое имя: ");
  15.             string userName = Console.ReadLine();
  16.             Console.Write("Введите символ рамки: ");
  17.             string simbolFrame = Console.ReadLine();
  18.             if (simbolFrame.Length == 1)
  19.             {
  20.                 for(int x = 0; x < userName.Length + 2; x++)
  21.                 {
  22.                     frameLine += simbolFrame;
  23.                 }
  24.                 Console.WriteLine($"{frameLine}\n" +
  25.                     $"{simbolFrame}{userName}{simbolFrame}\n" +
  26.                     $"{frameLine}");
  27.             }
  28.             else
  29.             {
  30.                 Console.WriteLine("Напишите один символ");
  31.             }
  32.             Console.ReadKey();
  33.         }
  34.     }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement