Advertisement
MaoChessy

Task 12 - fix

Oct 26th, 2020
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2.  
  3. namespace C_sharp_Light
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string name;
  10.             string frameChar;
  11.             Console.Write("Выше имя - ");
  12.             name = Console.ReadLine();
  13.             Console.Write("Символ - ");
  14.             frameChar = Console.ReadLine();
  15.  
  16.             int xOutput = 0;
  17.             int yOutputStart = 8;
  18.             int yOutputFinish = 11;
  19.  
  20.             if (frameChar.Length > 1)
  21.                 frameChar = frameChar.Substring(0, 1);
  22.  
  23.             for (int x = xOutput; x < name.Length+2; x++)
  24.             {
  25.                 for (int y = yOutputStart; y < yOutputFinish; y++)
  26.                 {
  27.                     Console.SetCursorPosition(x, y);
  28.                     Console.Write(frameChar);
  29.                 }
  30.             }
  31.             Console.SetCursorPosition((xOutput+1), (yOutputStart    + 1));
  32.             Console.Write(name);
  33.  
  34.             Console.SetCursorPosition(xOutput, yOutputFinish); // Увод курсора с вывода.
  35.             Console.ReadKey();
  36.         }
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement