Code:
#include <iostream>
#include <string>
#include <windows.h>
#include <stdio.h>
#include <time.h>
using namespace std;
int main() {
srand ( time ( NULL ) );
unsigned short int NumberOfPassWord; // Number of passwords
unsigned short int PassWordLong; // How Long The PassWord
char Alphabet [74] = {'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','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','0','1','2','3','4',
'5','6','7','8','9','!','@','#','$','%','^','&','*','(',')',
'?','~' };
char Char [] = { '1','2','3','4',
'5','6','7','8','9','!','@','#','$','%','^','&','*','(',')',
'?','~' };
cout << "Enter length of password\n>";
cin >> PassWordLong;
cout << "Enter number of passwords\n>";
cin >> NumberOfPassWord;
for ( unsigned short int counterN = 1; counterN <= NumberOfPassWord; counterN++ ) {
for ( unsigned short int counterL = 1; counterL <= PassWordLong; counterL++ )
cout << Alphabet [ rand() % 74 ];
for ( ; Alphabet == Char; PassWordLong-- );
cout << endl;
}
system("pause");
return(0);
}
Same problem