fork download
  1. #include <stdio.h>
  2. int main(void) {
  3. int n, i;
  4. char in[81], c;
  5. scanf("%d",&n);
  6. while(n--){
  7. scanf("%s",in);
  8. //printf("in = %s\n",in);
  9. for(i=0;i<81&&in[i]!=0;i++){
  10. if(in[i]=='%'){
  11. if(in[i+1]=='2'){
  12. switch(in[i+2]){
  13. case '0':
  14. c = ' ';
  15. i+=2;
  16. break;
  17. case '1':
  18. c = '!';
  19. i+=2;
  20. break;
  21. case '4':
  22. c = '$';
  23. i+=2;
  24. break;
  25. case '5':
  26. c = '%';
  27. i+=2;
  28. break;
  29. case '8':
  30. c = '(';
  31. i+=2;
  32. break;
  33. case '9':
  34. c = ')';
  35. i+=2;
  36. break;
  37. case 'a':
  38. c = '*';
  39. i+=2;
  40. break;
  41. default :
  42. c = in[i];
  43. }
  44. printf("%c", c);
  45. continue;
  46. }
  47. }
  48. printf("%c",in[i]);
  49. }
  50. printf("\n");
  51. }
  52. return 0;
  53. }
  54.  
Success #stdin #stdout 0s 2252KB
stdin
2
Happy%20Joy%20Joy%21
http://a...content-available-to-author-only...t.com/%2a
stdout
Happy Joy Joy!
http://a...content-available-to-author-only...t.com/*