Hello all. I am trying to make a program that will cycle through all the possible solutions until it reaches the same word as the inputted word. Here is my code:
#include "stdafx.h"
int main()
{
string Pass2;
char Pass[10];
char MPass[10];
cout << "> ";
cin >> Pass; //takes in input for pass
double x = strlen(Pass);
double max = pow(x, 2);
char Alpha[26] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'};
cout << "-------------------------------------------------------------------------" << endl;
cout << "Estimated MAX Possible: " << (max)*26 << endl;
cout << "Estimated MAX Time Over Internet (30ms): " << (max * 30) << "S" << endl;
cout << "Continue? Press ENTER." << endl;
cout << "-------------------------------------------------------------------------" << endl;
cin.get();
cin.ignore();
for (int i = 0; i <= x; i++)
{
if (i == x)
Pass[i] = '\0';
else
continue;
}
for (int i = 0; i <= x; i++)
{
if (i != x)
MPass[i] = Alpha[0];
else
MPass[i] = '\0';
}
int i = 0, a = 0, b = 0, c = 0, d = 0, e = 0;
while (true)
{
MPass[0] = Alpha[i];
if (i == 25)
{
i = 0;
MPass[1] = Alpha[a];