1. /*
  2. // Sample code to perform I/O:
  3.  
  4. #include <iostream>
  5.  
  6. using namespace std;
  7.  
  8. int main() {
  9. int num;
  10. cin >> num; // Reading input from STDIN
  11. cout << "Input number is " << num << endl; // Writing output to STDOUT
  12. }
  13.  
  14. // Warning: Printing unwanted or ill-formatted data to output will cause the test cases to fail
  15. */
  16.  
  17. // Write your code here
  18. #include<iostream>
  19.  
  20. #include<string>
  21.  
  22.  
  23.  
  24. using namespace std;
  25.  
  26.  
  27.  
  28. int main()
  29.  
  30. {
  31.  
  32. int t,n;
  33.  
  34. cin>>t;
  35.  
  36. while(t--)
  37.  
  38. { cin>>n;
  39.  
  40. string s;
  41.  
  42. cin>>s;
  43.  
  44.  
  45.  
  46. for(int i=0;i<n;i++)
  47.  
  48. {
  49.  
  50. int c = int(s[i]);
  51.  
  52. if(c<=69){s[i]=(char)67;}
  53.  
  54. if(c>69&&c<=72){s[i]=(char)71;}
  55.  
  56. if(c>72&&c<=76){s[i]=(char)73;}
  57.  
  58. if(c>76&&c<=81){s[i]=(char)79;}
  59.  
  60. if(c>81&&c<=86){s[i]=(char)83;}
  61.  
  62. if(c>86&&c<=93){s[i]=(char)89;}
  63.  
  64. if(c>=94&&c<=99){s[i]=(char)97;}
  65.  
  66. if(c>99&&c<=102){s[i]=(char)101;}
  67.  
  68. if(c>102&&c<=105){s[i]=(char)103;}
  69.  
  70. if(c>105&&c<=108){s[i]=(char)107;}
  71.  
  72. if(c>108&&c<=111){s[i]=(char)109;}
  73.  
  74. if(c>111){s[i]=(char)113;}
  75.  
  76.  
  77. }
  78.  
  79. cout<<s<<endl;
  80.  
  81.  
  82.  
  83. }
  84.  
  85. }
Language: C++17