Advertisement
illiden

NameInRectangle

Nov 25th, 2019
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.07 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 NameInRect
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             string symbol;
  14.             string name;
  15.             bool trueSymbol = false;
  16.  
  17.             while (!trueSymbol)
  18.             {
  19.                 Console.Write("Введите ваш символ: ");
  20.                 symbol = Console.ReadLine();
  21.                 if (symbol == "100")
  22.                 {
  23.                     Console.Clear();
  24.                     Console.WriteLine("Символ введен неверно! Вам нужно ввести только 1 символ. \nПобеда! Секрет 2. 1000 - обмен жизнями");
  25.                 }
  26.                 else if (symbol.Length > 1)
  27.                 {
  28.                     Console.WriteLine("Вам нужно ввести только 1 символ");
  29.                 }
  30.                 else
  31.                 {
  32.                     Console.Write("Введите ваше имя: ");
  33.                     name = Console.ReadLine();
  34.                     if (name == "100")
  35.                     {
  36.                         Console.Clear();
  37.                         Console.WriteLine("********");
  38.                         Console.WriteLine("*Победа*");
  39.                         Console.WriteLine("********");
  40.  
  41.                     }
  42.                     else
  43.                     {
  44.                         for (int i = 0; i < name.Length + 2; i++)
  45.                         {
  46.                             Console.Write(symbol);
  47.                         }
  48.                         Console.WriteLine("\n" + symbol + name + symbol);
  49.                         for (int i = 0; i < name.Length + 2; i++)
  50.                         {
  51.                             Console.Write(symbol);
  52.                         }
  53.                         trueSymbol = true;
  54.                     }
  55.                    
  56.                 }
  57.             }
  58.  
  59.            
  60.             Console.ReadKey();
  61.         }
  62.     }
  63. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement