Language: C++


#include <bits/stdc++.h>
using namespace std;
int main(){
    int N;
    cin>>N;
    N=N%10 ;
    switch (N) {
        case :2
            cout<<"hon"<<endl;
            break;
            case :4
                      cout<<"hon"<<endl;
                      break;
            case :5
                      cout<<"hon"<<endl;
                      break;
            case :7
                      cout<<"hon"<<endl;
                      break;
        case :9
                        cout<<"hon"<<endl;
            break;
            case :0
                      cout<<"pon"<<endl;
                      break;
            case :1
                      cout<<"pon"<<endl;
                      break;
            case :6
                      cout<<"pon"<<endl;
                      break;
            case :8
                      cout<<"pon"<<endl;
                      break;
            case :3
                      cout<<"bon"<<endl;
                      break;
            
            
            
            
        default:
            break;
    }
    
return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:9:14: error: expected primary-expression before ':' token
    9 |         case :2
      |              ^
a.cc:9:16: error: expected ';' before 'cout'
    9 |         case :2
      |                ^
      |                ;
   10 |             cout<<"hon"<<endl;
      |             ~~~~
a.cc:12:18: error: expected primary-expression before ':' token
   12 |             case :4
      |                  ^
a.cc:12:20: error: expected ';' before 'cout'
   12 |             case :4
      |                    ^
      |                    ;
   13 |                       cout<<"hon"<<endl;
      |                       ~~~~
a.cc:15:18: error: expected primary-expression before ':' token
   15 |             case :5
      |                  ^
a.cc:15:20: error: expected ';' before 'cout'
   15 |             case :5
      |                    ^
      |                    ;
   16 |                       cout<<"hon"<<endl;
      |                       ~~~~
a.cc:18:18: error: expected primary-expression before ':' token
   18 |             case :7
      |                  ^
a.cc:18:20: error: expected ';' before 'cout'
   18 |             case :7
      |                    ^
      |                    ;
   19 |                       cout<<"hon"<<endl;
      |                       ~~~~
a.cc:21:14: error: expected primary-expression before ':' token
   21 |         case :9
      |              ^
a.cc:21:16: error: expected ';' before 'cout'
   21 |         case :9
      |                ^
      |                ;
   22 |                         cout<<"hon"<<endl;
      |                         ~~~~
a.cc:24:18: error: expected primary-expression before ':' token
   24 |             case :0
      |                  ^
a.cc:24:20: error: expected ';' before 'cout'
   24 |             case :0
      |                    ^
      |                    ;
   25 |                       cout<<"pon"<<endl;
      |                       ~~~~
a.cc:27:18: error: expected primary-expression before ':' token
   27 |             case :1
      |                  ^
a.cc:27:20: error: expected ';' before 'cout'
   27 |             case :1
      |                    ^
      |                    ;
   28 |                       cout<<"pon"<<endl;
      |                       ~~~~
a.cc:30:18: error: expected primary-expression before ':' token
   30 |             case :6
      |                  ^
a.cc:30:20: error: expected ';' before 'cout'
   30 |             case :6
      |                    ^
      |                    ;
   31 |                       cout<<"pon"<<endl;
      |                       ~~~~
a.cc:33:18: error: expected primary-expression before ':' token
   33 |             case :8
      |                  ^
a.cc:33:20: error: expected ';' before 'cout'
   33 |             case :8
      |                    ^
      |                    ;
   34 |                       cout<<"pon"<<endl;
      |                       ~~~~
a.cc:36:18: error: expected primary-expression before ':' token
   36 |             case :3
      |                  ^
a.cc:36:20: error: expected ';' before 'cout'
   36 |             case :3
      |                    ^
      |                    ;
   37 |                       cout<<"bon"<<endl;
      |                       ~~~~