Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int pw(void){
- int i, n_passwords;
- int j = 1, k;
- char c;
- printf("Indique o número de passwords que deseja : ");
- scanf("%d", &n_passwords);
- char pass[n_passwords][14];
- srand(time(NULL));
- while (j <= n_passwords){
- k = 0;
- for (i = 0; i < 3; ++i){
- c = 'a' + rand() % ('z' - 'a' + 1);
- printf("%c", c);
- pass[j-1][k++] = c;
- }
- for (i = 0; i < 3; ++i){
- c = 'A' + rand() % ('Z' - 'A' + 1);
- printf("%c", c);
- pass[j-1][k++] = c;
- }
- for (i = 0; i < 3; ++i){
- c = '1' + rand() % ('1' - '9' + 1);
- printf("%c", c);
- pass[j-1][k++] = c;
- }
- for (i = 0; i < 4; ++i){
- c = '!' + rand() % ('!' - '/' + 1);
- printf("%c", c);
- pass[j-1][k++] = c;
- }
- j++;
- printf("\n\n");
- }
- system("pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement