Advertisement
Vadim_Rogulev

Untitled

Apr 12th, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.05 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 Вывод_имени
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             string name = Console.ReadLine();
  14.             int z = name.Length;
  15.             int Width = z + 4; //Console.WindowWidth;
  16.             int Height = 2; //Console.WindowHeight;
  17.             for (int i = 0; i < Width; i++)
  18.             {
  19.                 Console.SetCursorPosition(i, 0);
  20.                 Console.Write("*");
  21.                 Console.SetCursorPosition(i, Height);
  22.                 Console.Write("*");
  23.             }
  24.             for (int i = 1; i < Height; i++)
  25.             {
  26.                 Console.SetCursorPosition(0, i);
  27.                 Console.Write("*");
  28.                 Console.SetCursorPosition(Width - 1, i);
  29.                 Console.Write("*");
  30.             }
  31.             Console.SetCursorPosition(2, 1);
  32.             Console.Write(name);
  33.             Console.ReadKey();
  34.         }
  35.     }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement