criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include <iostream>
#include <string>
using namespace std;
int main() {
string n;
cin >> n;
int sum = 0;
for (int i = 0; i < n.length(); i++) {
        sum += n[i] - '0';
}
if (n % sum == 0) cout << "Yes";
else cout << "No";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:7: error: no match for 'operator%' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
   11 | if (n % sum == 0) cout << "Yes";
      |     ~ ^ ~~~
      |     |   |
      |     |   int
      |     std::string {aka std::__cxx11::basic_string<char>}
Language: C++

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

int main() {
  int N;
  cin >> N;
  int copy = N;
  int f(N) = 0;
  for (int i = 0; i < 9; i++) {
    f(N) = f(N) + copy % 10;
    copy = copy / 10;
  }
  if (N % f(N) == 0) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:12: error: expected ',' or ';' before '=' token
    8 |   int f(N) = 0;
      |            ^
a.cc:10:6: error: 'f' cannot be used as a function
   10 |     f(N) = f(N) + copy % 10;
      |     ~^~~
a.cc:10:13: error: 'f' cannot be used as a function
   10 |     f(N) = f(N) + copy % 10;
      |            ~^~~
a.cc:13:12: error: 'f' cannot be used as a function
   13 |   if (N % f(N) == 0) {
      |           ~^~~
Language: C++

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

int main() {
  int N;
  cin >> N;
  int copy = N;
  int fN = 0;
  for (int i = 0, i < 9, i++) {
    fN = fN + copy % 10;
    copy = copy / 10;
  }
  if (N % fN == 0) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:20: error: expected ';' before '<' token
    9 |   for (int i = 0, i < 9, i++) {
      |                    ^~
      |                    ;
a.cc:9:21: error: expected primary-expression before '<' token
    9 |   for (int i = 0, i < 9, i++) {
      |                     ^
a.cc:9:29: error: expected ';' before ')' token
    9 |   for (int i = 0, i < 9, i++) {
      |                             ^
      |                             ;
Language: C++

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

int main() {
  int N;
  cin >> N;
  int copy = N;
  int fN = 0;
  for (int i = 0, i < 9, i++) {
    fN = fN + copy % 10
    copy = copy / 10
  }  
  if (N % fN == 0) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:20: error: expected ';' before '<' token
    9 |   for (int i = 0, i < 9, i++) {
      |                    ^~
      |                    ;
a.cc:9:21: error: expected primary-expression before '<' token
    9 |   for (int i = 0, i < 9, i++) {
      |                     ^
a.cc:9:29: error: expected ';' before ')' token
    9 |   for (int i = 0, i < 9, i++) {
      |                             ^
      |                             ;
a.cc:10:24: error: expected ';' before 'copy'
   10 |     fN = fN + copy % 10
      |                        ^
      |                        ;
   11 |     copy = copy / 10
      |     ~~~~
Language: C++

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

int main() {
  int N, c;
  cin >> N;
  c = N;
  for (int i=0; i<9; i++) {
    t = t + c % 10;
    c = c % 10;
  }
  if (N % t == 0) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: 't' was not declared in this scope
    9 |     t = t + c % 10;
      |     ^
a.cc:12:11: error: 't' was not declared in this scope
   12 |   if (N % t == 0) {
      |           ^
Language: C++

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

int main() {
  int N, c;
  cin >> N;
  c = N;
  for (int i=0, i<9, i++) {
    t = t + c % 10;
    c = c % 10;
  }
  if (N % t == 0) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:18: error: expected ';' before '<' token
    8 |   for (int i=0, i<9, i++) {
      |                  ^
      |                  ;
a.cc:8:18: error: expected primary-expression before '<' token
a.cc:8:25: error: expected ';' before ')' token
    8 |   for (int i=0, i<9, i++) {
      |                         ^
      |                         ;
a.cc:9:5: error: 't' was not declared in this scope
    9 |     t = t + c % 10;
      |     ^
a.cc:12:11: error: 't' was not declared in this scope
   12 |   if (N % t == 0) {
      |           ^
Language: C++

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

int main() {
  int N, Ni;
  cin >> N;
  int n = N;
  int Sum = 0;
  for (int i = 8; i >= 0 ; i++) {
    int p = 1;
    for (int k = 0; k < i; k++) {
      p = p * 10
    }
    Ni = n/p; // N = sum of Ni*10^i i=0~8
    n = n - Ni * p;
    Sum = Sum + Ni;
  }
  if (N % Sum == 0) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:17: error: expected ';' before '}' token
   12 |       p = p * 10
      |                 ^
      |                 ;
   13 |     }
      |     ~
Language: C++

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

int main() {
  int N, Ni;
  cin >> N;
  int n = N;
  int Sum = 0;
  for (int i = 8; i >= 0 ; i++) {
    Ni = n/(10**i); // N = sum of Ni*10^i i=0~8
    n = n - Ni*10**i;
    Sum = Sum + Ni;
  }
  if (N % Sum == 0) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:16: error: invalid type argument of unary '*' (have 'int')
   10 |     Ni = n/(10**i); // N = sum of Ni*10^i i=0~8
      |                ^~
a.cc:11:19: error: invalid type argument of unary '*' (have 'int')
   11 |     n = n - Ni*10**i;
      |                   ^~
Language: C++

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

int main() {
  int N, Ni;
  cin >> N;
  int n = N;
  int Sum = 0;
  for (i = 8; i >= 0 ; i++) {
    Ni = n/(10**i); // N = sum of Ni*10^i i=0~8
    n = n - Ni*10**i;
    Sum = Sum + Ni;
  }
  if (N % Sum == 0) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:8: error: 'i' was not declared in this scope
    9 |   for (i = 8; i >= 0 ; i++) {
      |        ^
Language: C++

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

int main() {
  int N, Nk, Sum, k;
  cin >> N;
  for (k = 0; k < 8; k++) {
    Nk = Nk - Nk % 10**(8-k); // Nk=sk*10^(8-k)
    Sum = Sum + Nk/(10**(8-k));
  }
  if (N % Sum == 0) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:23: error: invalid type argument of unary '*' (have 'int')
    8 |     Nk = Nk - Nk % 10**(8-k); // Nk=sk*10^(8-k)
      |                       ^~~~~~
a.cc:9:24: error: invalid type argument of unary '*' (have 'int')
    9 |     Sum = Sum + Nk/(10**(8-k));
      |                        ^~~~~~
Language: C++

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

int main() {
  int N, Nk;
  int Sum;
  cin >> N;
  for (k = 0; k < 8; k++) {
    Nk = Nk - Nk % 10**(8-k); // Nk=sk*10^(8-k)
    Sum = Sum + Nk/(10**(8-k));
  }
  if (N % Sum == 0) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:8: error: 'k' was not declared in this scope; did you mean 'Nk'?
    8 |   for (k = 0; k < 8; k++) {
      |        ^
      |        Nk
Language: C++

#include<iostream>

int main() {
  int N;
  std::cin >> N;
  int temp_N = N
  int sum = 0;
  while (temp_N!=0) {
    sum += N%10;
    temp_N /= 10;
  }
  std::cout << sum << std::endl;
  if (N % sum == 0) {
    std::cout << "Yes" << std::endl;
  }
  else {
    std::cout << "No" << std::endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: expected ',' or ';' before 'int'
    7 |   int sum = 0;
      |   ^~~
a.cc:9:5: error: 'sum' was not declared in this scope
    9 |     sum += N%10;
      |     ^~~
a.cc:12:16: error: 'sum' was not declared in this scope
   12 |   std::cout << sum << std::endl;
      |                ^~~
Language: C++

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

int main(){
  int n,i;
  cin>>n;
  int sum=0;
  for(i=0,i<10;i++){
    sum+=(n/pow(10,i))%10;
  }
  if(n%sum==0)cout<<"Yes";
  else cout<<"No";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:19: error: expected ';' before ')' token
    8 |   for(i=0,i<10;i++){
      |                   ^
      |                   ;
a.cc:9:23: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'int' to binary 'operator%'
    9 |     sum+=(n/pow(10,i))%10;
      |          ~~~~~~~~~~~~~^~~
      |            |           |
      |            |           int
      |            __gnu_cxx::__promote<double>::__type {aka double}
Language: C++

#include <ios>
int main(){int n,N,r=0;scanf("%d",&n);N=n;while(N){r+=N%10;N/=10}puts(n%r?"No":"Yes");}

Compiler output:
a.cc: In function 'int main()':
a.cc:2:65: error: expected ';' before '}' token
    2 | int main(){int n,N,r=0;scanf("%d",&n);N=n;while(N){r+=N%10;N/=10}puts(n%r?"No":"Yes");}
      |                                                                 ^
      |                                                                 ;
Language: C++

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

int main(){
  int N,s=0;
  cin>>N;
  for(int i = 0;i<N.size();i++){
    s += N[i];
  }
  if (N % s == 0){
    cout<<"Yes"<<endl;
  }
    else{
    cout<<"No"<<endl;
  }
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:21: error: request for member 'size' in 'N', which is of non-class type 'int'
    7 |   for(int i = 0;i<N.size();i++){
      |                     ^~~~
a.cc:8:11: error: invalid types 'int[int]' for array subscript
    8 |     s += N[i];
      |           ^
Language: C++

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

int main() {
    int n;
    cin >> n;
    int f = 0;
    while (n/10 != 0) {
        f += n % 10;
        n /= 10;
    }
    if(x % f == 0) {
        cout << "Yes";
    }else {
        cout << "No";
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:8: error: 'x' was not declared in this scope
   12 |     if(x % f == 0) {
      |        ^
Language: C++

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

int main(){
long long int n;
  cin >> n;
  string s = to_string(n);
  long long int tmp=0;
  rep(i,s.size())tmp += (int)(s.at(i)-48)
  if(n/tmp==0) cout << "Yes" << endl;
  else cout << "No" << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:42: error: expected ';' before 'if'
   10 |   rep(i,s.size())tmp += (int)(s.at(i)-48)
      |                                          ^
      |                                          ;
   11 |   if(n/tmp==0) cout << "Yes" << endl;
      |   ~~                                      
a.cc:12:3: error: 'else' without a previous 'if'
   12 |   else cout << "No" << endl;
      |   ^~~~
Language: C++

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

int main() {
  
  int N,sum,ans;
  cin >> N;
  int i =0;
  int J = 1;
  
  while(true){
    J *=10;
    sum += N%J;
    N -= N%J;
 
    if(N == N%J)
      break:
  }
  
  ans = N%sum;
  
  if(ans =0)
    cout <<"Yes"<<endl;
  else
    cout<<"No"<<endl;
    
}



Compiler output:
a.cc: In function 'int main()':
a.cc:17:12: error: expected ';' before ':' token
   17 |       break:
      |            ^
      |            ;
a.cc:17:12: error: expected primary-expression before ':' token
Language: C++

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

int main() {
  
  int N,sum,ans;
  cin >> N;
  int i =0;
  int J = 1
  
  while(true){
    J *=10;
    sum += N%J;
    N -= N%J;
 
    if(N == N%J)
      break:
  }
  
  ans = N%sum;
  
  if(ans =0)
    cout <<"Yes"<<endl;
  else
    cout<<"No"<<endl;
    
}

    
      
    

}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:3: error: expected ',' or ';' before 'while'
   11 |   while(true){
      |   ^~~~~
a.cc: At global scope:
a.cc:33:1: error: expected declaration before '}' token
   33 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
string N;
int main() {
    cin >> N;
    int slen = N.length();
    long long n = stoll(N);
    long long sum = 0;
    for(int i = 0; i < slen; ++i) {
        sum += atoi(N.c_str();
    }
    cout << sum << endl;
    if(n % sum == 0) {
        cout << "Yes" << endl;
    }else {
        cout << "No" << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:30: error: expected ')' before ';' token
   10 |         sum += atoi(N.c_str();
      |                    ~         ^
      |                              )
Language: C++

#include<bits/stdc++.h>
using namespace std;
int sumOfDigit(int x) {
	int sum=0;
	while(x>0){
      sum += x%10;
      x /= 10;
    }
    return sum;
}
int main(){
  int n;
  cin >> n;
  int sum = sumOfDigit(n);
  if(n%sum==0) cout << "Yes" << endl;
  else: cout << "No" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:7: error: expected primary-expression before ':' token
   16 |   else: cout << "No" << endl;
      |       ^
Language: C++

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

int main() {
  int X,sum=0;
  cin>>X;
  int X=A;
  while(A>0){
    sum+=(A%10);
    A/=10;
  }
  if(X%sum==0)
    cout<<"Yes"<<endl;
  else
    cout<<"No"<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:7: error: redeclaration of 'int X'
    7 |   int X=A;
      |       ^
a.cc:5:7: note: 'int X' previously declared here
    5 |   int X,sum=0;
      |       ^
a.cc:7:9: error: 'A' was not declared in this scope
    7 |   int X=A;
      |         ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N, M;
  cin >> N;
  int A = 0;
  N = M;
  
  while (M > 0){
    A += M % 10;
    M = M / 10;
  }
 
  if (N % A == 0){
    cout << "Yes" << endl;
  }
  if else (N % A != 0){
    cout << "No" <<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:6: error: expected '(' before 'else'
   18 |   if else (N % A != 0){
      |      ^~~~
      |      (
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin>>N;
  int S=0;
  for(p=0;p<9;p++){
    int a=10^p;
    int R=N%a;
  	S+=R;
    N=N/10;
  }
  cout<<S<<endl;
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:7:7: error: 'p' was not declared in this scope
    7 |   for(p=0;p<9;p++){
      |       ^
Language: C++

#include<bits/stdc++.h>
using namespace std ; 
int main()
{
  int n , temp ; 
  cin>>n ; 
  temp = su ; 
  int su = 0 ; 
  while(n> 0 )
  {
    su += n%10 ; 
    n/=10 ; 
  }
  if(temp % su == 0 )
    	cout << "Yes"  ; 
  else
    	cout <<"No" ; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:10: error: 'su' was not declared in this scope
    7 |   temp = su ;
      |          ^~
Language: C++

#include <bits/stdc++.h>
#include <string>
using namespace std;
 
int main()
{
  std::string S;
  int N, i, p, sum;
  cin >> N;
  S=std::to_string(N);
  p=S.size();
  for (i=0;i<p;i++)
  {
    sum += atoi(S.at(p-i));
  }
  if(N%sum==0)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:21: error: invalid conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const char*' [-fpermissive]
   14 |     sum += atoi(S.at(p-i));
      |                 ~~~~^~~~~
      |                     |
      |                     __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char}
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:42,
                 from a.cc:1:
/usr/include/stdlib.h:105:30: note:   initializing argument 1 of 'int atoi(const char*)'
  105 | extern int atoi (const char *__nptr)
      |                  ~~~~~~~~~~~~^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
    int N; cin >> N;
    int X = 0;
    while(N >= 0){
        int x;
        N % 10 = x;
        X += x;
        N /= 10;
    }
    if(N % X == 0) cout << "Yes" << endl;
    else cout << "No" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:11: error: lvalue required as left operand of assignment
    8 |         N % 10 = x;
      |         ~~^~~~
Language: C++

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


int main() {
    int N;
    cin >> N;
    int s = func(N);

    if(N % s == 0){
        cout << "Yes" << endl;
    }
    else{
        cout << "No" << endl;
    }
    return 0;
}

int func(int N){
    if (N < 10) return N;
    return func(N / 10) + N % 10;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:13: error: 'func' was not declared in this scope
    9 |     int s = func(N);
      |             ^~~~
Language: C++

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

int main() {
  int N,a,b,c;
  bool d;
  cin >> N;
  
  a = N / 100;
  b = N % 100 / 10;
  c = N % 100 % 10;
  d = N % ( a + b + c )
    
  if(d == 0) {
  	cout << "Yes" << endl;
  }
  else {
  	cout << "No" << endl;
  }

}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:24: error: expected ';' before 'if'
   12 |   d = N % ( a + b + c )
      |                        ^
      |                        ;
   13 | 
   14 |   if(d == 0) {
      |   ~~                    
a.cc:17:3: error: 'else' without a previous 'if'
   17 |   else {
      |   ^~~~
Language: C++

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

int main() {
  int N,a,b,c;
  bool d;
  cin >> N;
  
  a = N / 100;
  b = N % 100 / 10;
  c = N % 100 % 10;
  d = N % ( a + b + c )
    
  if ( d == 0 ){
  	cout << "Yes" << endl;
  }
  else {
  	cout << "No" << endl;
  }

}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:24: error: expected ';' before 'if'
   12 |   d = N % ( a + b + c )
      |                        ^
      |                        ;
   13 | 
   14 |   if ( d == 0 ){
      |   ~~                    
a.cc:17:3: error: 'else' without a previous 'if'
   17 |   else {
      |   ^~~~
Language: C++

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

int main() {
  int N,i,s;
  cin >> N;
  for (i=1< ;i<100000000;i*10)
    s += N/i;
  if(N % s == 0){
    cout << "Yes" << endl;
  }
  else
    cout << "No"<< endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:13: error: expected primary-expression before ';' token
    7 |   for (i=1< ;i<100000000;i*10)
      |             ^
Language: C++

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

int main() {
  int a;
  cin >> a;
  
  
  if(a%(a%10+(a%100)/10+(a%1000)/100+(a%10000)/1000+(a%100000)/10000+(a%1000000)/100000+(a%10000000)/1000000+(a%100000000)/10000000+(a/100000000) == 0){
    cout <<"Yes" << endl;
    else{
      cout <<"No" <<endl;
    }
  }


Compiler output:
a.cc: In function 'int main()':
a.cc:9:152: error: expected ')' before '{' token
    9 |   if(a%(a%10+(a%100)/10+(a%1000)/100+(a%10000)/1000+(a%100000)/10000+(a%1000000)/100000+(a%10000000)/1000000+(a%100000000)/10000000+(a/100000000) == 0){
      |     ~                                                                                                                                                  ^
      |                                                                                                                                                        )
a.cc:14:4: error: expected statement at end of input
   14 |   }
      |    ^
a.cc:14:4: error: expected '}' at end of input
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

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

int main(){

  int N1,N2,a;
  cin >> N1;
  N2 = N1;
  while(1 <= N1){
  	a += N1 % 10;
    N1 /= 10;
  }
  if(N2 % a = 0){
  cout << "Yes";
  }else{
  cout << "No";
  }
}



Compiler output:
a.cc: In function 'int main()':
a.cc:13:9: error: lvalue required as left operand of assignment
   13 |   if(N2 % a = 0){
      |      ~~~^~~
Language: C++

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

int main(){

  int N1,N2,a;
  cin >> N1;
  N2 = N1;
  while(1 <= N1){
  	a += N1 % 10;
    N1 /= 10;
  }
  if(N2 % a = 0){
  cout << Yes;
  }else{
  cout << No;
  }
}



Compiler output:
a.cc: In function 'int main()':
a.cc:13:9: error: lvalue required as left operand of assignment
   13 |   if(N2 % a = 0){
      |      ~~~^~~
a.cc:14:11: error: 'Yes' was not declared in this scope
   14 |   cout << Yes;
      |           ^~~
a.cc:16:11: error: 'No' was not declared in this scope; did you mean 'N2'?
   16 |   cout << No;
      |           ^~
      |           N2
Language: C++

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

int main(){

  int N1,N2,a;
  cin >> N1 = N2;
  while(1 <= N1){
  	a += N1 % 10;
    N1 /= 10;
  }
  if(N2 % a = 0){
  cout << Yes;
  }else{
  cout << No;
  }
}



Compiler output:
a.cc: In function 'int main()':
a.cc:7:15: error: no match for 'operator=' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'int')
    7 |   cin >> N1 = N2;
      |               ^~
In file included from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127,
                 from a.cc:1:
/usr/include/c++/14/istream:718:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator=(std::basic_istream<_CharT, _Traits>&&) [with _CharT = char; _Traits = std::char_traits<char>]'
  718 |       operator=(basic_istream&& __rhs)
      |       ^~~~~~~~
/usr/include/c++/14/istream:718:33: note:   no known conversion for argument 1 from 'int' to 'std::basic_istream<char>&&'
  718 |       operator=(basic_istream&& __rhs)
      |                 ~~~~~~~~~~~~~~~~^~~~~
a.cc:12:9: error: lvalue required as left operand of assignment
   12 |   if(N2 % a = 0){
      |      ~~~^~~
a.cc:13:11: error: 'Yes' was not declared in this scope
   13 |   cout << Yes;
      |           ^~~
a.cc:15:11: error: 'No' was not declared in this scope; did you mean 'N2'?
   15 |   cout << No;
      |           ^~
      |           N2
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N, a, b;
  cin >> N;
  bool result;
  a = N % 10
  b = (N - a) * 0.1;
  a *= b;
  result = N % a;
  if (result) {
    cout << "No" << endl;
  }
  else {
    cout << "Yes" << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:13: error: expected ';' before 'b'
    8 |   a = N % 10
      |             ^
      |             ;
    9 |   b = (N - a) * 0.1;
      |   ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N, a, b;
  cin >> N;
  bool result;
  a = N % 10 + 1;
  b = N - a;
  a *= b;
  result = N % a;
  if (result) {
    cout << No << endl;
  }
  else {
    cout << Yes << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:13: error: 'No' was not declared in this scope; did you mean 'N'?
   13 |     cout << No << endl;
      |             ^~
      |             N
a.cc:16:13: error: 'Yes' was not declared in this scope
   16 |     cout << Yes << endl;
      |             ^~~
Language: C++

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

int main () {
  int N, M, fx, i;
  cin >> N;
  M = N
  fx = 0;
  
  for (i = 7; i > 0; i--) {
    fx += (N / (10 ^ i));
    N -= (N / (10 ^ i) * (10 ^ i));
  }
  
  if (M % fx == 0) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:8: error: expected ';' before 'fx'
    7 |   M = N
      |        ^
      |        ;
    8 |   fx = 0;
      |   ~~
Language: C++

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

int main() {
  int N;
  cin >> N;
  
  int X = 0;
  int T = 10000000;
  int T2;
  
  for (int i=0; i<8; i++) {
    
    for (int j=0; j<i; j++) {
      T /= 10
    }
    
    X += N/T;
    T2 = N/T;
    N -= T2*T;
  }
  
  if (N%X == 0) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:14: error: expected ';' before '}' token
   15 |       T /= 10
      |              ^
      |              ;
   16 |     }
      |     ~
Language: C++

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

int main() {
	int N,h,p;
  	cin >> N;
  	
  	h = N;
  	while (h > 0) {
    	p += h % 10; 
      	h /= 10;
        i++;
    }
  	
  	if (N % h == 0)	{
    	cout << "Yes" << endl;
    }
  
  	else {
    	cout << "No" << endl; 
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: 'i' was not declared in this scope
   12 |         i++;
      |         ^
Language: C++

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

int main() {
	int N,h;
  	cin >> N;
  
  	int i = 1;
  	while (10 * i < N) {
    	h += N % (10 * i) 
        i *= 10;
    }
  	
  	if (N % h == 0)	{
    	cout << "Yes" << endl;
    }
  
  	else {
    	cout << "No" << endl; 
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:26: error: expected ';' before 'i'
   10 |         h += N % (10 * i)
      |                          ^
      |                          ;
   11 |         i *= 10;
      |         ~
Language: C++

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

int main() {
	int N,h;
  	cin >> N;
  
  	int i = 1;
  	while (10 * i < N) {
    	h += N % (10 * i) 
        i *= 10 
    }
  	
  	if (N % h == 0)	{
    	cout << "Yes" << endl;
    }
  
  	else {
    	cout << "No" << endl; 
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:26: error: expected ';' before 'i'
   10 |         h += N % (10 * i)
      |                          ^
      |                          ;
   11 |         i *= 10
      |         ~
Language: C++

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

int main() {
	int N,h;
  	cin >> N;
  
  	int i = 0;
  	while (10 ** i < N) {
    	h += N % (10 ** i) 
    }
  	
  	if (N % h == 0)	{
    	cout << "Yes" << endl;
    }
  
  	else {
    	cout << "No" << endl; 
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:20: error: invalid type argument of unary '*' (have 'int')
    9 |         while (10 ** i < N) {
      |                    ^~~
a.cc:10:23: error: invalid type argument of unary '*' (have 'int')
   10 |         h += N % (10 ** i)
      |                       ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin >> N;
  int x =0,a=0;
  for(int i =0;i <8;i++){
    b= pow(10,i);
    x+= (N/b)%10;
  }
  if(N%x == 0)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: 'b' was not declared in this scope
    8 |     b= pow(10,i);
      |     ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin >> N;
  int x =0,a=0;
  for(int i = 1;N <= pow(10,i-1);i++){
    a= N-a*pow(10,i-1)%pow(10,i);
    x+= a;
  }
  if(N%x ==0)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:23: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and '__gnu_cxx::__promote<double>::__type' {aka 'double'} to binary 'operator%'
    8 |     a= N-a*pow(10,i-1)%pow(10,i);
      |          ~~~~~~~~~~~~~^~~~~~~~~~
      |           |               |
      |           |               __gnu_cxx::__promote<double>::__type {aka double}
      |           __gnu_cxx::__promote<double>::__type {aka double}
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main (){
  int N;
  cin >> N;
  int x =0,a=0;
  for(int i = 1;N <= pow(10,i-1);i++){
    a= N-a*pow(10,i-1)%(pow(10,i));
    x+= a;
  }
  if(N%x ==0)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:23: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and '__gnu_cxx::__promote<double>::__type' {aka 'double'} to binary 'operator%'
    8 |     a= N-a*pow(10,i-1)%(pow(10,i));
      |          ~~~~~~~~~~~~~^~~~~~~~~~~~
      |           |                |
      |           |                __gnu_cxx::__promote<double>::__type {aka double}
      |           __gnu_cxx::__promote<double>::__type {aka double}
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main (){
  int N;
  cin >> N;
  int x =0,a=0;
  for(int i = 1;N <= pow(10,i-1);i++){
    a= N-a*pow(10,i-1)%(pow(10,i))
    x+= a
  }
  if(N%x ==0)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:23: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and '__gnu_cxx::__promote<double>::__type' {aka 'double'} to binary 'operator%'
    8 |     a= N-a*pow(10,i-1)%(pow(10,i))
      |          ~~~~~~~~~~~~~^~~~~~~~~~~~
      |           |                |
      |           |                __gnu_cxx::__promote<double>::__type {aka double}
      |           __gnu_cxx::__promote<double>::__type {aka double}
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int a,b=0,c;
  cin>>a;
  c=a;
  while(true){
    if(c==0) break;
    b=b+c%10;
    c/=10;
  }
  if(a%b==0) cout<<"Yes";
  else cout<<"No";
  cout"\n";
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:14:7: error: expected ';' before string constant
   14 |   cout"\n";
      |       ^~~~
      |       ;
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  cin >> N;
 
  int wa = 0, tmp = N;
  
  while(tmp>0){
    wa += tmp % 10;	// N = 123 なら wa に 3 を足す
    tmp = N / 10;	// 次にN = 12 として ↑ の操作を繰り返す
  }
  
  cout << (N % wa == 0) ? "Yes" : "No" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:40: error: invalid operands of types 'const char [3]' and '<unresolved overloaded function type>' to binary 'operator<<'
   15 |   cout << (N % wa == 0) ? "Yes" : "No" << endl;
      |                                   ~~~~~^~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int a, b;
  cin >> a;
  for(;a > 0 ; a = a/10){
    b += a%10;
  }
  if (){
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:7: error: expected primary-expression before ')' token
    9 |   if (){
      |       ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int a, b;
  cin >> a;
  for(;a > 0 ; a = a/10){
    b += a%10;
  }
  if (a % b = 0){
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: lvalue required as left operand of assignment
    9 |   if (a % b = 0){
      |       ~~^~~
Language: C++

#include <iostream>
#include <stdio.h>
#include <string.h>
using namespace std;

long num=0;
int c,m,sum=0;
char n[9];

int main()
  {
  	gets(n);
  	m=strlen(n)-1;
  	for (int i=0;i<=m;++i)
  	  {
  	  	sum+=(n[i]-'0');
  	  	num=num*10+(n[i]-'0');
		}
	if (num%sum==0)
	  cout << "Yes" << endl;
	else cout << "No" << endl;
	return 0;
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
   12 |         gets(n);
      |         ^~~~
      |         getw
Language: C++

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

int main() {
  int N, S, sum, A = 100000000;
  cin >> N;

  for (int i = 0, i < 8, i++) {
  S = N / A;
  sum += S;
  A /= 10;
  }
   
  if ((N % sum) == 0)
  cout << Yes;
  else
  cout << No;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:20: error: expected ';' before '<' token
    8 |   for (int i = 0, i < 8, i++) {
      |                    ^~
      |                    ;
a.cc:8:21: error: expected primary-expression before '<' token
    8 |   for (int i = 0, i < 8, i++) {
      |                     ^
a.cc:8:29: error: expected ';' before ')' token
    8 |   for (int i = 0, i < 8, i++) {
      |                             ^
      |                             ;
a.cc:15:11: error: 'Yes' was not declared in this scope
   15 |   cout << Yes;
      |           ^~~
a.cc:17:11: error: 'No' was not declared in this scope; did you mean 'N'?
   17 |   cout << No;
      |           ^~
      |           N
Language: C++

#include <cstdio > int N; int main() { scanf("%d",&N); int t=N,c=0; while(t>0)c+=t%10,t/=10; if(N%c==0)puts("Yes"); else puts("No"); }

Compiler output:
a.cc:1:20: warning: extra tokens at end of #include directive
    1 | #include <cstdio > int N; int main() { scanf("%d",&N); int t=N,c=0; while(t>0)c+=t%10,t/=10; if(N%c==0)puts("Yes"); else puts("No"); }
      |                    ^~~
a.cc:1:10: fatal error: cstdio : No such file or directory
    1 | #include <cstdio > int N; int main() { scanf("%d",&N); int t=N,c=0; while(t>0)c+=t%10,t/=10; if(N%c==0)puts("Yes"); else puts("No"); }
      |          ^~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>

int main(){
  int inputnum = 0;
  int editnum = 0;
  int digitsum = 0;
  
  std::cin >> inputnum;
  
  editnum = inputsum;
  
  for(int i=0; i<8; i++){
    digitsum += (editsum % 10);
    editsum = editsum / 10;
  }
  
  if((inputsum / digitsum) == 0){
    std::cout << "Yes";
  }
  else{
    std::cout << "No";
  }
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:13: error: 'inputsum' was not declared in this scope; did you mean 'inputnum'?
   10 |   editnum = inputsum;
      |             ^~~~~~~~
      |             inputnum
a.cc:13:18: error: 'editsum' was not declared in this scope; did you mean 'editnum'?
   13 |     digitsum += (editsum % 10);
      |                  ^~~~~~~
      |                  editnum
Language: C++

#include<iostream>
#include<vector>
#include<string>
#include<numeric>
using namespace std;
int main()
{
	string n;
	cin >> n;

	int ans = 0;
	for_each(n.begin(),n.end(),[&ans](char i){
	    ans +=i-'0';
	    });
	    if(stoi(n)%ans==0){
	        cout<<"Yes";
	     }else{
	         cout<<"No";
	     }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: 'for_each' was not declared in this scope
   12 |         for_each(n.begin(),n.end(),[&ans](char i){
      |         ^~~~~~~~
Language: C++

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

int main() {
  int N, sum, n;
  sum = 0;
  n = 10000000;
  cin >> N;
  for (; n>=1; n/=10){
    sum += N/n
    N -= N-(N/n *n) 
  }
  if (N%sum == 0) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:15: error: expected ';' before 'N'
   10 |     sum += N/n
      |               ^
      |               ;
   11 |     N -= N-(N/n *n)
      |     ~
Language: C++

#include <iostream>
using namespace std;
int main(){
string a;
  int b;
  cin>>a;
  for(int i=0;i<a.size();i++){
  b+=a.size()/10*(a.size()-1-i)
  }
  if(a%b==0){
  cout<<"Yes"<<endl;
  }
  else cout<<"No"<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:32: error: expected ';' before '}' token
    8 |   b+=a.size()/10*(a.size()-1-i)
      |                                ^
      |                                ;
    9 |   }
      |   ~                             
a.cc:10:7: error: no match for 'operator%' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
   10 |   if(a%b==0){
      |      ~^~
      |      | |
      |      | int
      |      std::string {aka std::__cxx11::basic_string<char>}
Language: C

#include<stdio.h>
#include<string.h>
int main(){
  char s[10], a[2] = "a\n";
  int l, sum = 0;
  scanf("%s", s);
  l = strlen(s);
  for(int i = 0; i < l; ++i){
    a[0] = s[i];
    sum += atoi(a);
  }
  if(stoi(s) % sum) puts("Yes");
  else puts("No");
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:10:12: error: implicit declaration of function 'atoi' [-Wimplicit-function-declaration]
   10 |     sum += atoi(a);
      |            ^~~~
main.c:12:6: error: implicit declaration of function 'stoi' [-Wimplicit-function-declaration]
   12 |   if(stoi(s) % sum) puts("Yes");
      |      ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main( ){
  int N,S;
  cin>>N;
  vector<int>data;
  while(N=0) {
    S=N%10;
    N=N/10;
    data.push_back(S);
  }
  int count=0;
  for(int a:data) {
    count+=a;
  }
  
  if(N%count=0)
    cout<<"Yes"<<endl;
  else
    cout<<"No"<<endl;
}
    
  

Compiler output:
a.cc: In function 'int main()':
a.cc:17:7: error: lvalue required as left operand of assignment
   17 |   if(N%count=0)
      |      ~^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main( ){
  int N,S;
  cin>>N;
  vector<int>data;
  while(N=0) {
    S=N%10;
    N=N/10;
    data.push_back(S);
  }
  int count=0;
  for(int a:data) {
    cout+=a;
  }
  if(N%a==0)
    cout<<"Yes"<<endl;
  else
    cout<<"No"<<endl;
}
    
  

Compiler output:
a.cc: In function 'int main()':
a.cc:14:9: error: no match for 'operator+=' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int')
   14 |     cout+=a;
      |     ~~~~^~~
a.cc:16:8: error: 'a' was not declared in this scope
   16 |   if(N%a==0)
      |        ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main( ){
  int N,S;
  cin>>N;
  vector<int>data;
  while(N=0) {
    S=N%10;
    N=N/10;
    data.push_back(S);
  }
  int count=0;
  for(int a:data) {
    cout+=data.at[a];
  }
  if(N%a==0)
    cout<<"Yes"<<endl;
  else
    cout<<"No"<<endl;
}
    
  

Compiler output:
a.cc: In function 'int main()':
a.cc:14:18: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   14 |     cout+=data.at[a];
      |                  ^
a.cc:16:8: error: 'a' was not declared in this scope
   16 |   if(N%a==0)
      |        ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main( ){
  int N,S;
  cin>>N;
  vector<int>data;
  while(N=0) {
    S=N%10;
    N=N/10;
    data.push_back(S);
  }
  int count=0;
  int a;
  for(a:data) {
    cout+=data.at[a];
  }
  if(N%a==0)
    cout<<"Yes"<<endl;
  else
    cout<<"No"<<endl;
}
    
  

Compiler output:
a.cc: In function 'int main()':
a.cc:14:8: error: found ':' in nested-name-specifier, expected '::'
   14 |   for(a:data) {
      |        ^
      |        ::
a.cc:14:7: error: 'a' is not a class, namespace, or enumeration
   14 |   for(a:data) {
      |       ^
a.cc:17:3: error: expected primary-expression before 'if'
   17 |   if(N%a==0)
      |   ^~
a.cc:16:4: error: expected ';' before 'if'
   16 |   }
      |    ^
      |    ;
   17 |   if(N%a==0)
      |   ~~
a.cc:17:3: error: expected primary-expression before 'if'
   17 |   if(N%a==0)
      |   ^~
a.cc:16:4: error: expected ')' before 'if'
   16 |   }
      |    ^
      |    )
   17 |   if(N%a==0)
      |   ~~
a.cc:14:6: note: to match this '('
   14 |   for(a:data) {
      |      ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main( ){
  int N,S;
  cin>>N;
  vector<int>data;
  while(N=0) {
    S=N%10;
    N=N/10;
    data.push(S);
  }
  int count=0;
  int a;
  for(a:data) {
    cout+=data.at[a];
  }
  if(N%a==0)
    cout<<"Yes"<<endl;
  else
    cout<<"No"<<endl;
}
    
  

Compiler output:
a.cc: In function 'int main()':
a.cc:10:10: error: 'class std::vector<int>' has no member named 'push'
   10 |     data.push(S);
      |          ^~~~
a.cc:14:8: error: found ':' in nested-name-specifier, expected '::'
   14 |   for(a:data) {
      |        ^
      |        ::
a.cc:14:7: error: 'a' is not a class, namespace, or enumeration
   14 |   for(a:data) {
      |       ^
a.cc:17:3: error: expected primary-expression before 'if'
   17 |   if(N%a==0)
      |   ^~
a.cc:16:4: error: expected ';' before 'if'
   16 |   }
      |    ^
      |    ;
   17 |   if(N%a==0)
      |   ~~
a.cc:17:3: error: expected primary-expression before 'if'
   17 |   if(N%a==0)
      |   ^~
a.cc:16:4: error: expected ')' before 'if'
   16 |   }
      |    ^
      |    )
   17 |   if(N%a==0)
      |   ~~
a.cc:14:6: note: to match this '('
   14 |   for(a:data) {
      |      ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main( ){
  int N,S;
  cin>>N;
  vector<int>data;
  while(N=0) {
    S=N%10;
    N=N/10;
    data.push(S);
  }
  int count=0;
  int a;
  for(a:data) {
    cout+=data.[a];
  }
  if(N%a==0)
    cout<<"Yes"<<endl;
  else
    cout<<"No"<<endl;
}
    
  

Compiler output:
a.cc: In function 'int main()':
a.cc:10:10: error: 'class std::vector<int>' has no member named 'push'
   10 |     data.push(S);
      |          ^~~~
a.cc:14:8: error: found ':' in nested-name-specifier, expected '::'
   14 |   for(a:data) {
      |        ^
      |        ::
a.cc:14:7: error: 'a' is not a class, namespace, or enumeration
   14 |   for(a:data) {
      |       ^
a.cc:17:3: error: expected primary-expression before 'if'
   17 |   if(N%a==0)
      |   ^~
a.cc:16:4: error: expected ';' before 'if'
   16 |   }
      |    ^
      |    ;
   17 |   if(N%a==0)
      |   ~~
a.cc:17:3: error: expected primary-expression before 'if'
   17 |   if(N%a==0)
      |   ^~
a.cc:16:4: error: expected ')' before 'if'
   16 |   }
      |    ^
      |    )
   17 |   if(N%a==0)
      |   ~~
a.cc:14:6: note: to match this '('
   14 |   for(a:data) {
      |      ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main( ){
  int N,S;
  cin>>N;
  vector<int>data;
  while(N=0) {
    S=N%10;
    N=N/10;
    data.push(S);
  }
  int count=0;
  for(a:data) {
    cout+=data.[a];
  }
  if(N%a==0)
    cout<<"Yes"<<endl;
  else
    cout<<"No"<<endl;
}
    
  

Compiler output:
a.cc: In function 'int main()':
a.cc:10:10: error: 'class std::vector<int>' has no member named 'push'
   10 |     data.push(S);
      |          ^~~~
a.cc:13:8: error: found ':' in nested-name-specifier, expected '::'
   13 |   for(a:data) {
      |        ^
      |        ::
a.cc:13:7: error: 'a' has not been declared
   13 |   for(a:data) {
      |       ^
a.cc:16:3: error: expected primary-expression before 'if'
   16 |   if(N%a==0)
      |   ^~
a.cc:15:4: error: expected ';' before 'if'
   15 |   }
      |    ^
      |    ;
   16 |   if(N%a==0)
      |   ~~
a.cc:16:3: error: expected primary-expression before 'if'
   16 |   if(N%a==0)
      |   ^~
a.cc:15:4: error: expected ')' before 'if'
   15 |   }
      |    ^
      |    )
   16 |   if(N%a==0)
      |   ~~
a.cc:13:6: note: to match this '('
   13 |   for(a:data) {
      |      ^
a.cc:16:8: error: 'a' was not declared in this scope
   16 |   if(N%a==0)
      |        ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main( ){
  int N,S;
  cin>>N;
  vector<int>data;
  while(N=0) {
    S=N%10;
    N=N/10;
    data.push(S);
  }
  int a;
  a=sum(data);
  if(N%a==0)
    cout<<Yes<<endl;
  else
    cout<<No<<endl;
}
    
  

Compiler output:
a.cc: In function 'int main()':
a.cc:10:10: error: 'class std::vector<int>' has no member named 'push'
   10 |     data.push(S);
      |          ^~~~
a.cc:13:5: error: 'sum' was not declared in this scope
   13 |   a=sum(data);
      |     ^~~
a.cc:15:11: error: 'Yes' was not declared in this scope
   15 |     cout<<Yes<<endl;
      |           ^~~
a.cc:17:11: error: 'No' was not declared in this scope; did you mean 'N'?
   17 |     cout<<No<<endl;
      |           ^~
      |           N
Language: C++

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

void count(int input, int & sum)
{
  int temp = input / 10;
  if(temp == 0)
  {
    sum+= input % 10;
  }
  else
  {
    count(temp, sum)
  }
}
 
int main(){
  int N = 0;
  int sum;
  cin >> N;
  count(N, sum);
  if((sum % N) == 0)
  {
    cout << "Yes" << endl;
  }
  else
  {
    cout << "No" << endl;
  }
}


Compiler output:
a.cc: In function 'void count(int, int&)':
a.cc:13:21: error: expected ';' before '}' token
   13 |     count(temp, sum)
      |                     ^
      |                     ;
   14 |   }
      |   ~
Language: C++


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

void count(int input, int & sum)
{
  int temp = input / 10;
  if(temp == 0)
  {
    sum+= input %10;
  }
  else
  {
    count(temp, sum)
  }
}
 
int main(){
  int N = 0;
  int sum;
  cin >> N;
  count(N, sum);
  if((sum % 0) == 0)
  {
    cout << "Yes" << endl;
  }
  else
  {
    cout << "No" << endl;
  }
}


Compiler output:
a.cc: In function 'void count(int, int&)':
a.cc:14:21: error: expected ';' before '}' token
   14 |     count(temp, sum)
      |                     ^
      |                     ;
   15 |   }
      |   ~                  
a.cc: In function 'int main()':
a.cc:23:11: warning: division by zero [-Wdiv-by-zero]
   23 |   if((sum % 0) == 0)
      |       ~~~~^~~
Language: Java

import java.util.*;

public class Main {
    public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);
        
        int x = sc.nextInt();
        
        int 3digits = x / 100;
        int 2digits = (x / 10) % 10;
        int 1digits = x % 10;
        
        int ans = 3digits + 2digits + 1digits;
        
        if(x % ans == 0){
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
        
        System.out.println();
        
        sc.close();
        
    }
}


Compiler output:
Main.java:10: error: not a statement
        int 3digits = x / 100;
        ^
Main.java:10: error: ';' expected
        int 3digits = x / 100;
           ^
Main.java:11: error: not a statement
        int 2digits = (x / 10) % 10;
        ^
Main.java:11: error: ';' expected
        int 2digits = (x / 10) % 10;
           ^
Main.java:12: error: not a statement
        int 1digits = x % 10;
        ^
Main.java:12: error: ';' expected
        int 1digits = x % 10;
           ^
Main.java:14: error: ';' expected
        int ans = 3digits + 2digits + 1digits;
                    ^
Main.java:14: error: not a statement
        int ans = 3digits + 2digits + 1digits;
                          ^
Main.java:14: error: ';' expected
        int ans = 3digits + 2digits + 1digits;
                              ^
Main.java:14: error: not a statement
        int ans = 3digits + 2digits + 1digits;
                                    ^
Main.java:14: error: ';' expected
        int ans = 3digits + 2digits + 1digits;
                                        ^
11 errors
Language: C++

#include <iostream>
#include <string>

using namespace std;

int
main()
{
  string sn;
  cin >> sn;
  int n = 0;
  for (int i = 0; i < sn.length(); ++i) {
    n += stoi(sn[i], 1);
  }
  if (stoi(sn) % n == 0) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:14: error: no matching function for call to 'stoi(__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type&, int)'
   13 |     n += stoi(sn[i], 1);
      |          ~~~~^~~~~~~~~~
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:4164:3: note: candidate: 'int std::__cxx11::stoi(const std::string&, std::size_t*, int)'
 4164 |   stoi(const string& __str, size_t* __idx = 0, int __base = 10)
      |   ^~~~
/usr/include/c++/14/bits/basic_string.h:4164:22: note:   no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const std::string&' {aka 'const std::__cxx11::basic_string<char>&'}
 4164 |   stoi(const string& __str, size_t* __idx = 0, int __base = 10)
      |        ~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:4432:3: note: candidate: 'int std::__cxx11::stoi(const std::wstring&, std::size_t*, int)'
 4432 |   stoi(const wstring& __str, size_t* __idx = 0, int __base = 10)
      |   ^~~~
/usr/include/c++/14/bits/basic_string.h:4432:23: note:   no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const std::wstring&' {aka 'const std::__cxx11::basic_string<wchar_t>&'}
 4432 |   stoi(const wstring& __str, size_t* __idx = 0, int __base = 10)
      |        ~~~~~~~~~~~~~~~^~~~~