Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;

int main(){
    int n;
  cin >> n;
  if(n.size() == 1){
  if(n == 3) cout << "bon" << endl;
  else if (n == 0 || n == 1 || n == 6 || n== 8) cout << "pon" << endl;
  else cout << "hon" << endl;
  }
  else if(n.size() == 2){
      if(n.at(1) == 3) cout << "bon" << endl;
      else if (n.at(1) == 0 || n.at(1) == 1 || n.at(1) == 6 || n.at(1)== 8) cout << "pon" << endl;
      else cout << "hon" << endl;
  }
  else {
      if(n.at(2) == 3) cout << "bon" << endl;
      else if (n.at(2) == 0 || n.at(2) == 1 || n.at(2) == 6 || n.at(2)== 8) cout << "pon" << endl;
      else cout << "hon" << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:8: error: request for member 'size' in 'n', which is of non-class type 'int'
   10 |   if(n.size() == 1){
      |        ^~~~
a.cc:15:13: error: request for member 'size' in 'n', which is of non-class type 'int'
   15 |   else if(n.size() == 2){
      |             ^~~~
a.cc:16:12: error: request for member 'at' in 'n', which is of non-class type 'int'
   16 |       if(n.at(1) == 3) cout << "bon" << endl;
      |            ^~
a.cc:17:18: error: request for member 'at' in 'n', which is of non-class type 'int'
   17 |       else if (n.at(1) == 0 || n.at(1) == 1 || n.at(1) == 6 || n.at(1)== 8) cout << "pon" << endl;
      |                  ^~
a.cc:17:34: error: request for member 'at' in 'n', which is of non-class type 'int'
   17 |       else if (n.at(1) == 0 || n.at(1) == 1 || n.at(1) == 6 || n.at(1)== 8) cout << "pon" << endl;
      |                                  ^~
a.cc:17:50: error: request for member 'at' in 'n', which is of non-class type 'int'
   17 |       else if (n.at(1) == 0 || n.at(1) == 1 || n.at(1) == 6 || n.at(1)== 8) cout << "pon" << endl;
      |                                                  ^~
a.cc:17:66: error: request for member 'at' in 'n', which is of non-class type 'int'
   17 |       else if (n.at(1) == 0 || n.at(1) == 1 || n.at(1) == 6 || n.at(1)== 8) cout << "pon" << endl;
      |                                                                  ^~
a.cc:21:12: error: request for member 'at' in 'n', which is of non-class type 'int'
   21 |       if(n.at(2) == 3) cout << "bon" << endl;
      |            ^~
a.cc:22:18: error: request for member 'at' in 'n', which is of non-class type 'int'
   22 |       else if (n.at(2) == 0 || n.at(2) == 1 || n.at(2) == 6 || n.at(2)== 8) cout << "pon" << endl;
      |                  ^~
a.cc:22:34: error: request for member 'at' in 'n', which is of non-class type 'int'
   22 |       else if (n.at(2) == 0 || n.at(2) == 1 || n.at(2) == 6 || n.at(2)== 8) cout << "pon" << endl;
      |                                  ^~
a.cc:22:50: error: request for member 'at' in 'n', which is of non-class type 'int'
   22 |       else if (n.at(2) == 0 || n.at(2) == 1 || n.at(2) == 6 || n.at(2)== 8) cout << "pon" << endl;
      |                                                  ^~
a.cc:22:66: error: request for member 'at' in 'n', which is of non-class type 'int'
   22 |       else if (n.at(2) == 0 || n.at(2) == 1 || n.at(2) == 6 || n.at(2)== 8) cout << "pon" << endl;
      |                                                                  ^~