Language: C++

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

int main() {
  int X, N;
  cin >> X;
  N = X;
  if(X / 100000000 >= 1){
  int O, SM, HM, JM, M, S, H, J, I;
  O = X % 100000000;
  X = O;
  SM = X % 10000000;
  X = SM;
  HM = X % 1000000;
  X = HM
  JM = X % 100000;
  X = JM;
  M = X %10000
  X = M;
  S = X % 1000;
  X = S;
  H = X % 100;
  X = H:
  J = X % 10;
  X = J;
  I = X % 1;
  X = I;
  X = o + SM + HM + JM + M + S + H + J + I;
  if(N % X == 0){
  cout << "Yes" << endl;
  }else{
  cout << "No" << endl;
  }
  }else if(X / 10000000 >= 1){ 
  int SM, HM, JM, M, S, H, J, I;
  SM = X % 10000000;
  X = SM;
  HM = X % 1000000;
  X = HM
  JM = X % 100000;
  X = JM;
  M = X %10000
  X = M;
  S = X % 1000;
  X = S;
  H = X % 100;
  X = H:
  J = X % 10;
  X == J;
  I == X % 1;
  X == I;
  X == SM + HM + JM + M + S + H + J + I;
  if(N % X == 0){
  cout << "Yes" << endl;
  }else{
  cout << "No" << endl;
  }
  }else if(X / 1000000 >= 1){
  int HM, JM, M, S, H, J, I;
  HM == X % 1000000;
  X == HM
  JM == X % 100000;
  X == JM;
  M == X %10000
  X == M;
  S == X % 1000;
  X == S;
  H == X % 100;
  X == H:
  J == X % 10;
  X == J;
  I == X % 1;
  X == I;
  X == HM + JM + M + S + H + J + I;
  if(N % X == 0){
  cout << "Yes" << endl;
  }else{
  cout << "No" << endl;
  }
  }else if(X % 100000 >= 1)
  int JM, M, S, H, J, I;
  JM == X % 100000;
  X == JM;
  M == X %10000
  X == M;
  S == X % 1000;
  X == S;
  H == X % 100;
  X == H:
  J == X % 10;
  X == J;
  I == X % 1;
  X == I;
  X == o + SM + HM + JM + M + S + H + J + I;
  if(N % X == 0){
  cout << "Yes" << endl;
  }else{
  cout << "No" << endl;
  }
}else if(X % 10000 >= 1){
int M, S, H, J, I;
  M == X %10000
  X == M;
  S == X % 1000;
  X == S;
  H == X % 100;
  X == H:
  J == X % 10;
  X == J;
  I == X % 1;
  X == I;
  X == M + S + H + J + I;
  if(N % X == 0){
  cout << "Yes" << endl;
  }else{
  cout << "No" << endl;
  }
}else if(X % 1000 >= 1){
int S, H, J, I;
  S == X % 1000;
  X == S;
  H == X % 100;
  X == H:
  J == X % 10;
  X == J;
  I == X % 1;
  X == I; 
  X == S + H + J + I;
  if(N % X == 0){
  cout << "Yes" << endl;
  }else{
  cout << "No" << endl;
  }
}else if(X % 100 >= 1){
int H; J; I;
  H == X % 100;
  X == H:
  J == X % 10;
  X == J;
  I == X % 1;
  X == I;
  X == H + J + I;
  if(N % X == 0){
  cout << "Yes" << endl;
  }else{
  cout << "No" << endl;
  }
}else if(X % 10 >= 1){
int J, I;
  J == X % 10;
  X == J;
  I == X % 1;
  X == I;
  X == J + I;
  if(N % X == 0){
  cout << "Yes" << endl;
  }else{
  cout << "No" << endl;
  }
}else if(X % 1 >= 1){
  I == X % 1;
  X == I;
  if(N % X == 0){
  cout << "Yes" << endl;
  }else{
  cout << "No" << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:9: error: expected ';' before 'JM'
   15 |   X = HM
      |         ^
      |         ;
   16 |   JM = X % 100000;
      |   ~~     
a.cc:18:15: error: expected ';' before 'X'
   18 |   M = X %10000
      |               ^
      |               ;
   19 |   X = M;
      |   ~            
a.cc:23:8: error: found ':' in nested-name-specifier, expected '::'
   23 |   X = H:
      |        ^
      |        ::
a.cc:23:7: error: 'H' is not a class, namespace, or enumeration
   23 |   X = H:
      |       ^
a.cc:28:7: error: 'o' was not declared in this scope
   28 |   X = o + SM + HM + JM + M + S + H + J + I;
      |       ^
a.cc:39:9: error: expected ';' before 'JM'
   39 |   X = HM
      |         ^
      |         ;
   40 |   JM = X % 100000;
      |   ~~     
a.cc:42:15: error: expected ';' before 'X'
   42 |   M = X %10000
      |               ^
      |               ;
   43 |   X = M;
      |   ~            
a.cc:47:8: error: found ':' in nested-name-specifier, expected '::'
   47 |   X = H:
      |        ^
      |        ::
a.cc:47:7: error: 'H' is not a class, namespace, or enumeration
   47 |   X = H:
      |       ^
a.cc:61:10: error: expected ';' before 'JM'
   61 |   X == HM
      |          ^
      |          ;
   62 |   JM == X % 100000;
      |   ~~      
a.cc:64:16: error: expected ';' before 'X'
   64 |   M == X %10000
      |                ^
      |                ;
   65 |   X == M;
      |   ~             
a.cc:69:9: error: found ':' in nested-name-specifier, expected '::'
   69 |   X == H:
      |         ^
      |         ::
a.cc:69:8: error: 'H' is not a class, namespace, or enumeration
   69 |   X == H:
      |        ^
a.cc:82:3: error: 'JM' was not declared in this scope
   82 |   JM == X % 100000;
      |   ^~
a.cc:84:3: error: 'M' was not declared in this scope
   84 |   M == X %10000
      |   ^
a.cc:86:3: error: 'S' was not declared in this scope
   86 |   S == X % 1000;
      |   ^
a.cc:88:3: error: 'H' was not declared in this scope
   88 |   H == X % 100;
      |   ^
a.cc:89:9: error: found ':' in nested-name-specifier, expected '::'
   89 |   X == H:
      |         ^
      |         ::
a.cc:89:8: error: 'H' is not a class, namespace, or enumeration
   89 |   X == H:
      |        ^
a.cc:91:8: error: 'J' was not declared in this scope
   91 |   X == J;
      |        ^
a.cc:92:3: error: 'I' was not declared in this scope
   92 |   I == X % 1;
      |   ^
a.cc:94:8: error: 'o' was not declared in this scope
   94 |   X == o + SM + HM + JM + M + S + H + J + I;
      |        ^
a.cc:94:12: error: 'SM' was not declared in this scope
   94 |   X == o + SM + HM + JM + M + S + H + J + I;
      |            ^~
a.cc:94:17: error: 'HM' was not declared in this scope
   94 |   X == o + SM + HM + JM + M + S + H + J + I;
      |                 ^~
a.cc: At global scope:
a.cc:100:2: error: expected unqualified-id before 'else'
  100 | }else if(X % 10000 >= 1){
      |  ^~~~
a.cc:118:2: error: expected unqualified-id before 'else'
  118 | }else if(X % 1000 >= 1){
      |  ^~~~
a.cc:134:2: error: expected unqualified-id before 'else'
  134 | }else if(X % 100 >= 1){
      |  ^~~~
a.cc:148:2: error: expected unqualified-id before 'else'
  148 | }else if(X % 10 >= 1){
      |  ^~~~
a.cc:160:2: error: expected unqualified-id before 'else'
  160 | }else if(X % 1 >= 1){
      |  ^~~~