Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- int main(int argc, char *argv[])
- {
- if (argc < 3)
- {
- printf("Not enough arguments\n");
- return 0;
- }
- char values[] = "abcdefghijklmnopqrstuvwxyz";
- char word[5];
- char String[5];
- strcpy(word, argv[1]);
- int i, key = atoi(argv[2]);
- for (i = 0; i < strlen(word); i++)
- {
- char find = word[i];
- const char *ptr = strchr(values, find);
- int index = ptr - values;
- String[i] = values[index+key];
- }
- printf("%s\n", String );
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement