Browse Source

Passwortgenerator Sonderzeichen

remotes/origin/tictactoedev
Kevin Ludwig 11 months ago
parent
commit
f55147b0b3
  1. 4
      src/passwortgenerator.c

4
src/passwortgenerator.c

@ -5,14 +5,14 @@
int run_passwortGenerator(){ int run_passwortGenerator(){
printf("\nPasswort Generator\n\n"); printf("\nPasswort Generator\n\n");
char zeichen[] = "abcdefghijklmnopqrstuvwxyz0123456789";
char zeichen[] = "abcdefghijklmnopqrstuvwxyz0123456789!%&/()=?*#";
int tmp = 0; int tmp = 0;
int GroSSklein = 0; int GroSSklein = 0;
printf("\nIhr Passwort: "); printf("\nIhr Passwort: ");
srand(time(0)); srand(time(0));
for(int i = 0; i < 10; i++) for(int i = 0; i < 10; i++)
{ {
tmp = rand()%36;
tmp = rand()%46;
GroSSklein = rand()%2; GroSSklein = rand()%2;
printf("%c", (tmp<26?(GroSSklein==0?toupper(zeichen[tmp]):zeichen[tmp]):zeichen[tmp])); printf("%c", (tmp<26?(GroSSklein==0?toupper(zeichen[tmp]):zeichen[tmp]):zeichen[tmp]));
} }

Loading…
Cancel
Save