Language: C++

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

int check(char c){
  char left[15]={q,a,z,w,s,x,e,d,c,r,f,v,t,g,b};
  char right[11]={y,h,n,u,j,m,i,k,o,l,p};
 
  for(int i = 0 ; i < 11 ; i++){
    if(left[i] == c) return 0;
    else return 1;
  }
  return 0;
}


int main(){
  string str;
  
  while(1){  
    cin >> str;
    if(str == "#") break;
    
    int cnt = 0;
    for(int i = 1 ; i < str.size() ; i++){
      if(check(str[i-1]!=check(str[i])) cnt++;
    } 
    cout << cnt << endl;
  }

  return 0;
}

Compiler output:
a.cc: In function 'int check(char)':
a.cc:6:18: error: 'q' was not declared in this scope
    6 |   char left[15]={q,a,z,w,s,x,e,d,c,r,f,v,t,g,b};
      |                  ^
a.cc:6:20: error: 'a' was not declared in this scope
    6 |   char left[15]={q,a,z,w,s,x,e,d,c,r,f,v,t,g,b};
      |                    ^
a.cc:6:22: error: 'z' was not declared in this scope
    6 |   char left[15]={q,a,z,w,s,x,e,d,c,r,f,v,t,g,b};
      |                      ^
a.cc:6:24: error: 'w' was not declared in this scope
    6 |   char left[15]={q,a,z,w,s,x,e,d,c,r,f,v,t,g,b};
      |                        ^
a.cc:6:26: error: 's' was not declared in this scope
    6 |   char left[15]={q,a,z,w,s,x,e,d,c,r,f,v,t,g,b};
      |                          ^
a.cc:6:28: error: 'x' was not declared in this scope
    6 |   char left[15]={q,a,z,w,s,x,e,d,c,r,f,v,t,g,b};
      |                            ^
a.cc:6:30: error: 'e' was not declared in this scope
    6 |   char left[15]={q,a,z,w,s,x,e,d,c,r,f,v,t,g,b};
      |                              ^
a.cc:6:32: error: 'd' was not declared in this scope
    6 |   char left[15]={q,a,z,w,s,x,e,d,c,r,f,v,t,g,b};
      |                                ^
a.cc:6:36: error: 'r' was not declared in this scope
    6 |   char left[15]={q,a,z,w,s,x,e,d,c,r,f,v,t,g,b};
      |                                    ^
a.cc:6:38: error: 'f' was not declared in this scope
    6 |   char left[15]={q,a,z,w,s,x,e,d,c,r,f,v,t,g,b};
      |                                      ^
a.cc:6:40: error: 'v' was not declared in this scope
    6 |   char left[15]={q,a,z,w,s,x,e,d,c,r,f,v,t,g,b};
      |                                        ^
a.cc:6:42: error: 't' was not declared in this scope
    6 |   char left[15]={q,a,z,w,s,x,e,d,c,r,f,v,t,g,b};
      |                                          ^
a.cc:6:44: error: 'g' was not declared in this scope
    6 |   char left[15]={q,a,z,w,s,x,e,d,c,r,f,v,t,g,b};
      |                                            ^
a.cc:6:46: error: 'b' was not declared in this scope
    6 |   char left[15]={q,a,z,w,s,x,e,d,c,r,f,v,t,g,b};
      |                                              ^
a.cc:7:19: error: 'y' was not declared in this scope
    7 |   char right[11]={y,h,n,u,j,m,i,k,o,l,p};
      |                   ^
a.cc:7:21: error: 'h' was not declared in this scope
    7 |   char right[11]={y,h,n,u,j,m,i,k,o,l,p};
      |                     ^
a.cc:7:23: error: 'n' was not declared in this scope
    7 |   char right[11]={y,h,n,u,j,m,i,k,o,l,p};
      |                       ^
a.cc:7:25: error: 'u' was not declared in this scope
    7 |   char right[11]={y,h,n,u,j,m,i,k,o,l,p};
      |                         ^
a.cc:7:27: error: 'j' was not declared in this scope
    7 |   char right[11]={y,h,n,u,j,m,i,k,o,l,p};
      |                           ^
a.cc:7:29: error: 'm' was not declared in this scope
    7 |   char right[11]={y,h,n,u,j,m,i,k,o,l,p};
      |                             ^
a.cc:7:31: error: 'i' was not declared in this scope
    7 |   char right[11]={y,h,n,u,j,m,i,k,o,l,p};
      |                               ^
a.cc:7:33: error: 'k' was not declared in this scope
    7 |   char right[11]={y,h,n,u,j,m,i,k,o,l,p};
      |                                 ^
a.cc:7:35: error: 'o' was not declared in this scope
    7 |   char right[11]={y,h,n,u,j,m,i,k,o,l,p};
      |                                   ^
a.cc:7:37: error: 'l' was not declared in this scope
    7 |   char right[11]={y,h,n,u,j,m,i,k,o,l,p};
      |                                     ^
a.cc:7:39: error: 'p' was not declared in this scope
    7 |   char right[11]={y,h,n,u,j,m,i,k,o,l,p};
      |                                       ^
a.cc: In function 'int main()':
a.cc:26:40: error: expected ';' before 'cnt'
   26 |       if(check(str[i-1]!=check(str[i])) cnt++;
      |                                        ^~~~
      |                                        ;
a.cc:27:5: error: expected primary-expression before '}' token
   27 |     }
      |     ^
a.cc:26:47: error: expected ')' before '}' token
   26 |       if(check(str[i-1]!=check(str[i])) cnt++;
      |         ~                                     ^
      |                                               )
   27 |     }
      |     ~                                          
a.cc:27:5: error: expected primary-expression before '}' token
   27 |     }
      |     ^