SHOW:
|
|
- or go back to the newest paste.
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 | - | for (int x = 0; x < name.Length+2; x++) |
19 | + | |
20 | if (frameChar.Length > 1) | |
21 | - | for (int y = 8; y < 11; y++) |
21 | + | |
22 | ||
23 | for (int x = xOutput; x < name.Length+2; x++) | |
24 | { | |
25 | for (int y = yOutputStart; y < yOutputFinish; y++) | |
26 | { | |
27 | - | Console.SetCursorPosition(1, 9); |
27 | + | |
28 | Console.Write(frameChar); | |
29 | } | |
30 | - | Console.SetCursorPosition(0, 11); |
30 | + | |
31 | Console.SetCursorPosition((xOutput+1), (yOutputStart + 1)); | |
32 | Console.Write(name); | |
33 | ||
34 | Console.SetCursorPosition(xOutput, yOutputFinish); // Увод курсора с вывода. | |
35 | Console.ReadKey(); | |
36 | } | |
37 | } | |
38 | } |