Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Stack<char> password = new Stack<char>();
- Random dig = new Random();
- string alphabat = "abcdefghijklmnopqrstuvwxyz";
- int counter = 0, temp = 0;
- char ch;
- long num = 248410397744610;
- while (num != 0)
- {
- counter++;
- temp = dig.Next(0, 26);
- if ((num - temp) % 17 != 0)
- {
- while ((num - temp) % 17 != 0)
- {
- temp = dig.Next(0, 26);
- }
- }
- ch = alphabat[temp-1];
- password.Push(ch);
- num -= temp;
- num /= 17;
- if (num < 0)
- {
- num = 248410397744610;
- password.Clear();
- counter = 0;
- }
- }
- Console.WriteLine("The length is: " + counter);
- Console.Write("The password is: ");
- ch = password.Pop();
- Console.Write(ch);
- for (int i = 0; i < counter - 1; i++)
- {
- ch = password.Pop();
- Console.Write(ch);
- }
- Console.WriteLine("");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement