Advertisement
CYRAX228

Untitled

Feb 21st, 2020
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.96 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.  
  14.             Console.Write("Введите свое имя:");
  15.             string name = Console.ReadLine();
  16.             Console.Write("Какую рамочку вы хотите:");
  17.             char frame = Convert.ToChar(Console.Read());
  18.             int nameLenght = name.Length;
  19.             for (int i = 0; i < 3; i++)
  20.             {
  21.                 if (i == 1)
  22.                 {
  23.                     Console.Write(frame + name + frame);
  24.                 }
  25.                 else
  26.                 {
  27.                     for (int l = 0; l < nameLenght + 2; l++)
  28.                     {
  29.                         Console.Write(frame);
  30.                     }
  31.                 }
  32.                 Console.WriteLine();
  33.             }
  34.         }
  35.     }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement