Advertisement
RedFlys

HomeWork8. Exit controller

Aug 21st, 2020
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.58 KB | None | 0 0
  1. using System;
  2.  
  3. namespace ConsoleApp8.ExitController
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int count = 0;
  10.             int countLevelUp = 10000;
  11.             string attack = "attack";
  12.             string exit = "exit";
  13.             string userInput;
  14.  
  15.             Console.WriteLine("Сегодня у вас будет тренировка по вводу. Введите attack 10 000 раз, что бы увеличить навык ввода. Для выхода введите exit.");
  16.  
  17.             while (count < countLevelUp)
  18.             {
  19.                 userInput = Console.ReadLine();
  20.  
  21.                 if (userInput == attack)
  22.                 {
  23.                     Console.WriteLine("Вы ввели attack, счётчик повысился на 1.");
  24.                 }
  25.                 else if (userInput == exit)
  26.                 {
  27.                     Console.WriteLine("Сожалеем, что вы сдались, до свидания.");
  28.                     break;
  29.                 }
  30.                 else
  31.                 {
  32.                     Console.WriteLine("Введите корректно.");
  33.                 }
  34.  
  35.                 Console.ReadKey();
  36.                 Console.Clear();
  37.             }
  38.  
  39.             if (count >= countLevelUp)
  40.             {
  41.                 Console.WriteLine("Вы справились, вы сумасшедший!!!");
  42.             }
  43.  
  44.             Console.WriteLine("Нажмите любую клавишу, что бы выйти.");
  45.             Console.ReadKey();
  46.         }
  47.     }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement