Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.13 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace Aufgabe7_SaLeiendecker
  7. {
  8.     class Program
  9.     {
  10.         static void Main(string[] args)
  11.         {
  12.             Char Ein;
  13.             int i = 1;
  14.             int j = 1;
  15.             char[] Zahl;
  16.             Zahl =new char[4];
  17.             bool VVV = false;
  18.             bool BBB = false;
  19.             bool FFF = false;
  20.             bool LLL = false;
  21.  
  22.             for (j = 1; j < 4; j++)
  23.             {
  24.                 Console.WriteLine("Versuch {0}:", j);
  25.  
  26.                 for (i = 0; i < 4; i++)
  27.                 {
  28.                     Console.WriteLine("Bitte geben Sie einen Buchstaben ein.");
  29.                     Ein = Convert.ToChar(Console.ReadLine());
  30.                     Zahl[i] = Ein;
  31.  
  32.                     if (Zahl[i] == 0x76 || Zahl[i] == 0x56)
  33.                     {
  34.                         VVV = true;
  35.                     }
  36.                     if (Zahl[i] == 0x66 || Zahl[i] == 0x46)
  37.                     {
  38.                         FFF = true;
  39.                     }
  40.                     if (Zahl[i] == 0x6c || Zahl[i] == 0x4c)
  41.                     {
  42.                         LLL = true;
  43.                     }
  44.                     if (Zahl[i] == 0x62 || Zahl[i] == 0x42)
  45.                     {
  46.                         BBB = true;
  47.                     }
  48.                 }
  49.  
  50.  
  51.                 if (VVV == true && BBB == true && FFF == true && LLL == true)
  52.                 {
  53.                     Console.WriteLine("Login korrekt.");
  54.                     j = 4;
  55.                 }
  56.                 else
  57.                 {
  58.                     Console.WriteLine("Login fehlgeschlagen.");
  59.                     VVV = false;
  60.                     BBB = false;
  61.                     FFF = false;
  62.                     LLL = false;
  63.                 }
  64.             }
  65.             //VFLB Original PW
  66.             //0x76 = v
  67.             //0x66 = f
  68.             //0x6c = l
  69.             //0x62 = b
  70.             //V = 0x56
  71.             //F = 0x46
  72.             //L = 0x4c
  73.             //B = 0x42
  74.            
  75.             Console.ReadLine();
  76.  
  77.         }
  78.     }
  79. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement