39 lines
539 B
C
39 lines
539 B
C
#include "stdio.h"
|
|
#include "stdlib.h"
|
|
#include "time.h"
|
|
#include "string.h"
|
|
|
|
|
|
int main(int arg, char** args) {
|
|
|
|
if(arg < 2) {
|
|
printf("Not enough Args\n");
|
|
return 1;
|
|
}
|
|
|
|
int num_chars = atoi(args[1]);
|
|
|
|
char* crypto = malloc(sizeof(char) * (num_chars + 10));
|
|
|
|
srand(time(NULL));
|
|
|
|
char* tempstr = malloc(sizeof(char) * 2);
|
|
|
|
while(num_chars) {
|
|
|
|
char temp = 'A' + (rand() % 26);
|
|
|
|
sprintf(tempstr, "%c", temp);
|
|
strncat(crypto, tempstr, 1);
|
|
num_chars--;
|
|
}
|
|
|
|
printf("%s\n", crypto);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
}
|