Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace _1384
- {
- class Program
- {
- static void Main(string[] args)
- {
- string controll = String.Empty;
- string name = String.Empty;
- while (controll != "exit")
- {
- Console.WriteLine("Здравствуй, какую команду выполнить?");
- Console.WriteLine("1) SetName");
- Console.WriteLine("2) DisplayName");
- Console.WriteLine("3) SetColor");
- Console.WriteLine("4) DisplayBoxWithName");
- controll = Console.ReadLine();
- Console.Clear();
- switch (controll)
- {
- case "1":
- Console.WriteLine("Как тебя зовут?");
- name = Console.ReadLine();
- Console.WriteLine("Привет " + name);
- Console.WriteLine("Нажмите Enter");
- Console.ReadLine();
- Console.Clear();
- break;
- case "2":
- Console.WriteLine("Введи число");
- int ch = Convert.ToInt32(Console.ReadLine());
- if (name != "")
- {
- for (int i = 0; i < ch; i++)
- {
- Console.WriteLine(name);
- }
- Console.WriteLine("Нажмите Enter");
- Console.ReadLine();
- Console.Clear(); ;
- }
- else
- {
- Console.WriteLine("Ошибка, не задано имя в пункте №1");
- Console.ReadLine();
- Console.Clear(); ;
- }
- break;
- case "3":
- {
- Console.WriteLine("Какой цвет шрифта и фона задать?");
- Console.WriteLine("На выбор есть: cиний, зелёный, красный и ФиОлЕтОвЫй");
- string textcolor = Console.ReadLine();
- switch (textcolor)
- {
- case "синий и зелёный":
- {
- Console.ForegroundColor = ConsoleColor.Blue;
- Console.BackgroundColor = ConsoleColor.Green;
- break;
- }
- case "красный и зелёный":
- {
- Console.ForegroundColor = ConsoleColor.Red;
- Console.BackgroundColor = ConsoleColor.Green;
- break;
- }
- case "зелёный и красный":
- {
- Console.ForegroundColor = ConsoleColor.Green;
- Console.BackgroundColor = ConsoleColor.Red;
- break;
- }
- case "ФиОлЕтОвЫй и ФиОлЕтОвЫй":
- {
- Console.ForegroundColor = ConsoleColor.Magenta;
- break;
- }
- default:
- Console.WriteLine("Таких цветов нет");
- Console.ReadLine();
- Console.Clear(); ;
- break;
- }
- break;
- }
- case "4":
- {
- if (name != "")
- {
- string gr = "";
- int kv = name.Length;
- for (int i = 0; i <= name.Length + 1; i++)
- {
- gr += "#";
- }
- Console.WriteLine("Имечко в рамочке ^_^");
- Console.WriteLine(gr);
- Console.WriteLine("#" + name + "#");
- Console.WriteLine(gr);
- Console.ReadKey();
- Console.Clear();
- }
- else
- {
- Console.WriteLine("Ошибка, не задано имя в пункте №1");
- Console.ReadLine();
- Console.Clear(); ;
- }
- break;
- }
- case "exit":
- {
- Console.WriteLine("Досвидули");
- break;
- }
- }
- }
- Console.WriteLine("Мы будем скучать (нет)");
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment