Language: C++

#include<iostream>
#include<string>
#include<algorithm>
using namespace std;

int main(){
    int n;
    cin>>n;
    for(int i=0;i<n;i++){
        string order;
        cin>>order;
        string s;
        cin>>s;
        reverse(order.begin(),order.end());
        for(auto x:order){
            switch(x){
                case 'J':
                    reverse(s.begin(),s.end());
                    string s1=s.substr(0,1),s2=s.substr(1);
                    reverse(s2.begin(),s2.end());
                    s=s1+s2;
                    break;
                case 'C':
                    string s1=s.substr(0,1),s2=s.substr(1);
                    s=s2+s1;
                    break;
                case 'E':
                    int k=(int)s.size();
                    if(k%2){
                        string s1=s.substr(0,k/2),s2=s.substr(k/2,1),s3=s.substr(k/2+1);
                        s=s3+s2+s1;
                    }else{
                        string s1=s.substr(0,k/2),s2=s.substr(k/2);
                        s=s2+s1;
                    }
                    break;
                case 'A':
                    reverse(s.begin(),s.end());
                case 'P':
                    for(auto c:s){
                        if('1'<=c && c<='9')c--;
                        if(c=='0')c+=9;
                    }
                    break;
                case 'M':
                    for(auto c:s){
                        if('0'<=c && c<='8')c++;
                        if(c=='9')c-=9;
                    }
                    break;
            }
        }
        cout<<s<<endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:22: error: jump to case label
   23 |                 case 'C':
      |                      ^~~
a.cc:19:45: note:   crosses initialization of 'std::string s2'
   19 |                     string s1=s.substr(0,1),s2=s.substr(1);
      |                                             ^~
a.cc:19:28: note:   crosses initialization of 'std::string s1'
   19 |                     string s1=s.substr(0,1),s2=s.substr(1);
      |                            ^~
a.cc:24:28: error: redeclaration of 'std::string s1'
   24 |                     string s1=s.substr(0,1),s2=s.substr(1);
      |                            ^~
a.cc:19:28: note: 'std::string s1' previously declared here
   19 |                     string s1=s.substr(0,1),s2=s.substr(1);
      |                            ^~
a.cc:24:45: error: redeclaration of 'std::string s2'
   24 |                     string s1=s.substr(0,1),s2=s.substr(1);
      |                                             ^~
a.cc:19:45: note: 'std::string s2' previously declared here
   19 |                     string s1=s.substr(0,1),s2=s.substr(1);
      |                                             ^~
a.cc:27:22: error: jump to case label
   27 |                 case 'E':
      |                      ^~~
a.cc:19:45: note:   crosses initialization of 'std::string s2'
   19 |                     string s1=s.substr(0,1),s2=s.substr(1);
      |                                             ^~
a.cc:19:28: note:   crosses initialization of 'std::string s1'
   19 |                     string s1=s.substr(0,1),s2=s.substr(1);
      |                            ^~
a.cc:37:22: error: jump to case label
   37 |                 case 'A':
      |                      ^~~
a.cc:28:25: note:   crosses initialization of 'int k'
   28 |                     int k=(int)s.size();
      |                         ^
a.cc:19:45: note:   crosses initialization of 'std::string s2'
   19 |                     string s1=s.substr(0,1),s2=s.substr(1);
      |                                             ^~
a.cc:19:28: note:   crosses initialization of 'std::string s1'
   19 |                     string s1=s.substr(0,1),s2=s.substr(1);
      |                            ^~
a.cc:39:22: error: jump to case label
   39 |                 case 'P':
      |                      ^~~
a.cc:28:25: note:   crosses initialization of 'int k'
   28 |                     int k=(int)s.size();
      |                         ^
a.cc:19:45: note:   crosses initialization of 'std::string s2'
   19 |                     string s1=s.substr(0,1),s2=s.substr(1);
      |                                             ^~
a.cc:19:28: note:   crosses initialization of 'std::string s1'
   19 |                     string s1=s.substr(0,1),s2=s.substr(1);
      |                            ^~
a.cc:45:22: error: jump to case label
   45 |                 case 'M':
      |                      ^~~
a.cc:28:25: note:   crosses initialization of 'int k'
   28 |                     int k=(int)s.size();
      |                         ^
a.cc:19:45: note:   crosses initialization of 'std::string s2'
   19 |                     string s1=s.substr(0,1),s2=s.substr(1);
      |                                             ^~
a.cc:19:28: note:   crosses initialization of 'std::string s1'
   19 |                     string s1=s.substr(0,1),s2=s.substr(1);
      |                            ^~