Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  int n;
  cin>>n;
  if(n==3){
    cout<<"bon"<<endl;
  }
  else if(n==0){
    cout<<"pon"<<endl;
  }
  else if(n==1){
    cout<<"pon"<<endl;
  }
  else if(n==6){
    cout<<"pon"<<endl;
  }
  else if(n==8){
    cout<<"pon"<<endl;
  }
  else if(n==2){
    cout<<"hon"<<endl;
  }
  else if(n==4){
    cout<<"hon"<<endl;
  }
  else if(n==5){
    cout<<"hon"<<endl;
  }
  else if(n==7){
    cout<<"hon"<<endl;
  }
  else if(n==9){
    cout<<"hon"<<endl;
  }
  else if(n<100&&n[1]==3){
    cout<<"bon"<<endl;
  }
  else if(n<100&&n[1]==0){
    cout<<"pon"<<endl;
  }
  else if(n<100&&n[1]==1){
    cout<<"pon"<<endl;
  }
  else if(n<100&&n[1]==6){
    cout<<"pon"<<endl;
  }
  else if(n<100&&n[1]==8){
    cout<<"pon"<<endl;
  }
  else if(n<100&&n[1]==2){
    cout<<"hon"<<endl;
  }
  else if(n<100&&n[1]==4){
    cout<<"hon"<<endl;
  }
  else if(n<100&&n[1]==5){
    cout<<"hon"<<endl;
  }
  else if(n<100&&n[1]==7){
    cout<<"hon"<<endl;
  }
  else if(n<100&&n[1]==9){
    cout<<"hon"<<endl;
  }
  else if(n<1000&&n[2]==3){
    cout<<"bon"<<endl;
  }
  else if(n<1000&&n[2]==0){
    cout<<"pon"<<endl;
  }
  else if(n<1000&&n[2]==1){
    cout<<"pon"<<endl;
  }
  else if(n<1000&&n[2]==6){
    cout<<"pon"<<endl;
  }
  else if(n<1000&&n[2]==8){
    cout<<"pon"<<endl;
  }
  else if(n<1000&&n[2]==2){
    cout<<"hon"<<endl;
  }
  else if(n<1000&&n[2]==4){
    cout<<"hon"<<endl;
  }
  else if(n<1000&&n[2]==5){
    cout<<"hon"<<endl;
  }
  else if(n<1000&&n[2]==7){
    cout<<"hon"<<endl;
  }
  else if(n<1000&&n[2]==9){
    cout<<"hon"<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:19: error: invalid types 'int[int]' for array subscript
   37 |   else if(n<100&&n[1]==3){
      |                   ^
a.cc:40:19: error: invalid types 'int[int]' for array subscript
   40 |   else if(n<100&&n[1]==0){
      |                   ^
a.cc:43:19: error: invalid types 'int[int]' for array subscript
   43 |   else if(n<100&&n[1]==1){
      |                   ^
a.cc:46:19: error: invalid types 'int[int]' for array subscript
   46 |   else if(n<100&&n[1]==6){
      |                   ^
a.cc:49:19: error: invalid types 'int[int]' for array subscript
   49 |   else if(n<100&&n[1]==8){
      |                   ^
a.cc:52:19: error: invalid types 'int[int]' for array subscript
   52 |   else if(n<100&&n[1]==2){
      |                   ^
a.cc:55:19: error: invalid types 'int[int]' for array subscript
   55 |   else if(n<100&&n[1]==4){
      |                   ^
a.cc:58:19: error: invalid types 'int[int]' for array subscript
   58 |   else if(n<100&&n[1]==5){
      |                   ^
a.cc:61:19: error: invalid types 'int[int]' for array subscript
   61 |   else if(n<100&&n[1]==7){
      |                   ^
a.cc:64:19: error: invalid types 'int[int]' for array subscript
   64 |   else if(n<100&&n[1]==9){
      |                   ^
a.cc:67:20: error: invalid types 'int[int]' for array subscript
   67 |   else if(n<1000&&n[2]==3){
      |                    ^
a.cc:70:20: error: invalid types 'int[int]' for array subscript
   70 |   else if(n<1000&&n[2]==0){
      |                    ^
a.cc:73:20: error: invalid types 'int[int]' for array subscript
   73 |   else if(n<1000&&n[2]==1){
      |                    ^
a.cc:76:20: error: invalid types 'int[int]' for array subscript
   76 |   else if(n<1000&&n[2]==6){
      |                    ^
a.cc:79:20: error: invalid types 'int[int]' for array subscript
   79 |   else if(n<1000&&n[2]==8){
      |                    ^
a.cc:82:20: error: invalid types 'int[int]' for array subscript
   82 |   else if(n<1000&&n[2]==2){
      |                    ^
a.cc:85:20: error: invalid types 'int[int]' for array subscript
   85 |   else if(n<1000&&n[2]==4){
      |                    ^
a.cc:88:20: error: invalid types 'int[int]' for array subscript
   88 |   else if(n<1000&&n[2]==5){
      |                    ^
a.cc:91:20: error: invalid types 'int[int]' for array subscript
   91 |   else if(n<1000&&n[2]==7){
      |                    ^
a.cc:94:20: error: invalid types 'int[int]' for array subscript
   94 |   else if(n<1000&&n[2]==9){
      |                    ^