Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- char generateKey(char * ch)
- {
- int i, j, n;
- bool check1 = true, check2 = true, check3 = false;
- int length = strlen(ch);
- printf("%s: %d\n", ch, length);
- char *alphabet = "ZYXWVUTSRQPONMLKJIHGFEDCBA";
- char *endkey = "";
- for (i = 0; i < length; i++){
- n = strlen(endkey);
- for (j = 0; j < n; j++){
- n = strlen(endkey);
- printf("%s: %d\n", endkey, n);
- if (endkey[j] == ch[i]){
- check1 = false;
- }
- printf("Hi.\n");
- if (check1 != false){
- printf("Hey.\n");
- strcat(ch[i], endkey);
- printf("Evening.\n");
- check3 = true;
- }
- check1 = true;
- if (check3 == true){
- break;
- }
- }
- }
- for (i = 0; i < strlen(alphabet); i++){
- for (j = 0; j < strlen(endkey); j++){
- if (alphabet[i] == endkey[j]){
- check2 = false;
- }
- }
- if (check2 != false){
- strcat(i, endkey);
- }
- }
- return endkey;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement