Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <string.h>
- #include <stdio.h>
- #include<ctype.h>
- #include <stdlib.h>
- #define MAX 1024
- char temp[MAX];
- char temp1[MAX];
- int translate (int a, char * sets[])
- {
- int c;
- size_t i = 0;
- size_t e;
- char temp[MAX];
- char temp1[MAX];
- char temp2;
- for(i = 0; sets[a + 1][i] != '\0'; i++)
- temp[i] = sets[1][i];
- temp[i] = '\0';
- for(i = 0; sets[a + 2][i] != '\0'; i++)
- temp1[i] = sets[1][i];
- temp1[i] = '\0';
- while(((c = getchar()) != EOF)
- {
- for(i = 0; temp[i] != '\0'; i++)
- {
- if(c == temp[i])
- {
- putchar(temp1[i]);
- break;
- }
- }
- }
- return 0;
- }
- int main (int argc, char * argv[])
- {
- translate(argc, argv);
- return 0;
- }
Add Comment
Please, Sign In to add comment