Guest User

Untitled

a guest
Jan 23rd, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. #include <string.h>
  2. #include <stdio.h>
  3. #include<ctype.h>
  4. #include <stdlib.h>
  5.  
  6. #define MAX 1024
  7.  
  8. char temp[MAX];
  9. char temp1[MAX];
  10.  
  11.  
  12. int translate (int a, char * sets[])
  13. {
  14. int c;
  15. size_t i = 0;
  16. size_t e;
  17. char temp[MAX];
  18. char temp1[MAX];
  19. char temp2;
  20.  
  21. for(i = 0; sets[a + 1][i] != '\0'; i++)
  22. temp[i] = sets[1][i];
  23. temp[i] = '\0';
  24.  
  25. for(i = 0; sets[a + 2][i] != '\0'; i++)
  26. temp1[i] = sets[1][i];
  27. temp1[i] = '\0';
  28.  
  29. while(((c = getchar()) != EOF)
  30. {
  31. for(i = 0; temp[i] != '\0'; i++)
  32. {
  33. if(c == temp[i])
  34. {
  35. putchar(temp1[i]);
  36. break;
  37.  
  38. }
  39. }
  40. }
  41.  
  42. return 0;
  43. }
  44. int main (int argc, char * argv[])
  45. {
  46.  
  47. translate(argc, argv);
  48. return 0;
  49. }
Add Comment
Please, Sign In to add comment