1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
#include <windows.h>
#include <time.h>
#include <iostream>
using namespace std;
int main() {
char ar[] = {'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'};
string pass;
char add;
srand(time(NULL));
for (int i; i < 15; i++) {
int z = rand() % 25;
char add = ar[z];
int a = rand() % 1;
if (a == 1) {
toupper(add);
} else {
tolower(add);
}
pass.append(1, add);
}
cout << pass;
system("PAUSE >NUL");
}
|