Advertisement
Guest User

Untitled

a guest
Feb 24th, 2020
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. using System;
  2.  
  3. namespace ucheba_sharp5
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. string password = "1111";
  10. int attempt = 3;
  11. string input;
  12.  
  13. for(int i=1; i<=attempt; i++)
  14. {
  15. Console.WriteLine("Введите пароль");
  16. input = Console.ReadLine();
  17. if (input == password)
  18. {
  19. Console.WriteLine("СЕКРЕТНОЕ СЛОВО");
  20. Console.ReadKey();
  21. break;
  22. }
  23. else
  24. {
  25. Console.WriteLine($"Неверно. У вас осталось {attempt-i} попыток");
  26. }
  27. }
  28. }
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement