Advertisement
Guest User

Untitled

a guest
Aug 16th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.84 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 _1._3._8._1._2
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             string Pass;
  14.             int i;
  15.             int x = 5;
  16.             for (i=0; i<5; i++)
  17.             {
  18.                 Console.WriteLine("Введите пароль ");
  19.                 Pass = Console.ReadLine();
  20.                 if (Pass== "1234")
  21.                 {
  22.                     Console.WriteLine("Пароль введен верно!");
  23.                     break;                        
  24.                         }
  25.                 x--;
  26.                 Console.WriteLine("Осталось попыток ввода пароля: " + x);
  27.                
  28.  
  29.             }
  30.  
  31.         }
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement