Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Threading;
- namespace Kirill_Lox
- {
- class Program
- {
- public static string[] Try = new string[] { "gelbyukjh", "ljkjqg ghtplbtynf", "lfblbnsyfeq" };
- public static bool flag = true;
- static void Main(string[] args)
- {
- var periodicity = new TimeSpan(0, 0, 1);
- Thread th = new Thread(Timer);
- th.Start(periodicity);
- Chek();
- Console.ReadKey();
- }
- public static void Timer(object periodicity)
- {
- var time = default(TimeSpan);
- var thePeriodicity = (TimeSpan)periodicity;
- while (flag != false)
- {
- Thread.Sleep(thePeriodicity);
- time = time.Add(thePeriodicity);
- }
- Console.WriteLine(time);
- Console.ReadKey();
- }
- public static void Chek()
- {
- int miss = 0;
- for (int i = 0; i < Try.Length; i++)
- {
- Console.WriteLine(Try[i]);
- string key = Console.ReadLine();
- if (Try[i].ToLowerInvariant().Contains(key))
- {
- Try[i].Replace(key, " ");
- miss = Try[i].Length;
- }
- if (miss > 0)
- {
- Console.WriteLine("Try again");
- i -= 1;
- }
- }
- flag = false;
- Console.WriteLine($"Количество ошибок - {miss}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement