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(void)
- {
- char first[256], sec[256];
- fgets(first, 256, stdin);
- fgets(sec, 256, stdin);
- if (strlen(first) == strlen(sec))
- {
- int n;
- scanf("%d", &n);
- int length = strlen(first);
- char line[256];
- fgets(line, 256, stdin);
- for (int i = 0; i < n; i++)
- {
- fgets(line, 256, stdin);
- int len_l = strlen(line);
- for (int j = 0; j < len_l; j++)
- {
- int k = length - 1;
- while ((line[j] != first[k]) && (k >= 0))
- k--;
- if (k < 0)
- printf("%c", line[j]);
- else
- printf("%c", sec[k]);
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement