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

#include<bits/stdc++.h>
using namespace std;
int main(void){
  int n, pow10=1, fn=0;
  
  cin>>n;
  for(i=0;i<8;i++){
    fn += n/pow10%10
    pow10*=10  
  }
  
  if(n%fn==0)cout<<"Yes";
  else cout<<"No";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:7: error: 'i' was not declared in this scope
    7 |   for(i=0;i<8;i++){
      |       ^
a.cc:8:21: error: expected ';' before 'pow10'
    8 |     fn += n/pow10%10
      |                     ^
      |                     ;
    9 |     pow10*=10
      |     ~~~~~
Language: Java

import java.util.Scanner;
public class Main{
  public static void main(String[] args){
	Scanner sc = new Scanner(System.in);
    int N = Integer.parseInt(sc.next());
    int n = N;
    int fN = 0;
    
    while(n > 0){
      fN += n % 10; //1の位を取得
      n /= 10  //1桁ずらす  	
    }
    if(N % fN == 0) System.out.println("Yes");
    else System.out.println("No");   
  }
}




Compiler output:
Main.java:11: error: ';' expected
      n /= 10  //1????  	
             ^
1 error
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:10:16: error: expected ';' before 'if'
   10 |     j += i % 10
      |                ^
      |                ;
   11 |   if ( N % j == 0)
      |   ~~            
a.cc:13:3: error: 'else' without a previous 'if'
   13 |   else
      |   ^~~~
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:14:9: error: invalid operands of types 'int' and 'double' to binary 'operator%'
   14 |   if (n % a == 0) {
      |       ~ ^ ~
      |       |   |
      |       int double
Language: C++

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

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


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

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

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


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

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

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


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

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

int main() {
  int n;
  cin >> n;
  
  int n_temp = n;
  int fn;
  while(n_temp > 0) {
    fn += (n_temp % 10)
    n_temp /= 10;
  }
  int is_ha = (n % fn == 0)
  
  if(is_ha)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:24: error: expected ';' before 'n_temp'
   11 |     fn += (n_temp % 10)
      |                        ^
      |                        ;
   12 |     n_temp /= 10;
      |     ~~~~~~              
a.cc:16:3: error: expected ',' or ';' before 'if'
   16 |   if(is_ha)
      |   ^~
a.cc:18:3: error: 'else' without a previous 'if'
   18 |   else
      |   ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){

  int N[10000010]
  int a;
  cin >> N;
  
  while(N>0){
  
    a+= N % 10;
    N/10;
  }

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


Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: expected initializer before 'int'
    6 |   int a;
      |   ^~~
a.cc:7:10: error: 'N' was not declared in this scope
    7 |   cin >> N;
      |          ^
a.cc:11:5: error: 'a' was not declared in this scope
   11 |     a+= N % 10;
      |     ^
a.cc:15:9: error: 'a' was not declared in this scope
   15 |    if(N%a ==0){
      |         ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){

  int N;
  cin >> N;
  
  while(N>0){
  
    a+= N % 10;
    N/10;
  }

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

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

#include<bits/stdc++>
using namespace std;
int main(){
  int a;
  int b,c,d,e,f,g,h,i;
  b = a/10000000;
  c = a%10000000/1000000;
  d = a%1000000/100000;
  e = a%100000/10000;
  f = a%10000/1000;
  g = a%1000/100;
  h = a%100/10;
  i = a%10;
  h = b + c + d + e + f + g + h + i;
  if(a%h == 0)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}

Compiler output:
a.cc:1:9: fatal error: bits/stdc++: No such file or directory
    1 | #include<bits/stdc++>
      |         ^~~~~~~~~~~~~
compilation terminated.
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:21: error: 'n' was not declared in this scope
    7 |     int a,f; cin >> n;
      |                     ^
a.cc:8:25: error: request for member 'size' in 'a', which is of non-class type 'int'
    8 |     for(int i = 0;i < a.size();i++){
      |                         ^~~~
a.cc:9:15: error: invalid types 'int[int]' for array subscript
    9 |         f += a[i];
      |               ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  double N, i, a ;
  cin >> N ;
  i = 0 ;
  a = 0 ;
  
  for ( double i ; i < 10 ; i++ ) {
    N /= 10 ;
    
    if ( N <= 0 ) {
      cout << i + 1 << endl ;
      break ;
    }
  }
  
  for ( double j; j < i + 2 ; j++ ) {
    N /= ( 10 ^ i ) ;
    a += N ;
    
    if ( j = i + 1 && (( N / a ) * 10 ) % 10 == 0 ) {
      cout << "Yes" << endl ;
    }
    
    else if ( j = i + 1 && !(( N / a ) * 10 ) % 10 == 0 ) {
      cout << "No" << endl ;
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:15: error: invalid operands of types 'int' and 'double' to binary 'operator^'
   20 |     N /= ( 10 ^ i ) ;
      |            ~~ ^ ~
      |            |    |
      |            int  double
a.cc:23:41: error: invalid operands of types 'double' and 'int' to binary 'operator%'
   23 |     if ( j = i + 1 && (( N / a ) * 10 ) % 10 == 0 ) {
      |                       ~~~~~~~~~~~~~~~~~ ^ ~~
      |                                  |        |
      |                                  double   int
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  double N, i, a ;
  cin >> N ;
  i = 0 ;
  a = 0 ;
  
  for ( int i ; i < 10 ; i++ ) {
    N /= 10 ;
    
    if ( N <= 0 ) {
      cout << i + 1 << endl ;
      break ;
    }
  }
  
  for ( int j; j < i + 2 ; j++ ) {
    N /= ( 10 ^ i ) ;
    a += N ;
    
    if ( j = i + 1 && (( N / a ) * 10 ) % 10 == 0 ) {
      cout << "Yes" << endl ;
    }
    
    else if ( j = i + 1 && !(( N / a ) * 10 ) % 10 == 0 ) {
      cout << "No" << endl ;
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:15: error: invalid operands of types 'int' and 'double' to binary 'operator^'
   20 |     N /= ( 10 ^ i ) ;
      |            ~~ ^ ~
      |            |    |
      |            int  double
a.cc:23:41: error: invalid operands of types 'double' and 'int' to binary 'operator%'
   23 |     if ( j = i + 1 && (( N / a ) * 10 ) % 10 == 0 ) {
      |                       ~~~~~~~~~~~~~~~~~ ^ ~~
      |                                  |        |
      |                                  double   int
Language: Java

import java.util.*;

 
public class Main80B{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int sum = 0;
    int n = N;
    while(N > 0){
        sum = sum + N%10; 
        N /= 10; 
    }
    if(n%sum == 0){
        System.out.println("Yes"); 
    }else{
        System.out.println("No"); 
    }
        sc.close();
    }    
}


Compiler output:
Main.java:4: error: class Main80B is public, should be declared in a file named Main80B.java
public class Main80B{
       ^
1 error
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:7:8: error: expected ';' before 'for'
    7 |   n = N
      |        ^
      |        ;
    8 | 
    9 |   for (int i=1; i<=9; i++){
      |   ~~~   
a.cc:9:17: error: 'i' was not declared in this scope
    9 |   for (int i=1; i<=9; i++){
      |                 ^
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:11: fatal error:  cstdio : No such file or directory
    1 | # include < cstdio >
      |           ^~~~~~~~~~
compilation terminated.
Language: C++

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

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

Compiler output:
a.cc:2:1: error: 'ussing' does not name a type
    2 | ussing namespace std;
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:7:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |   cin >> N;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:14:13: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   14 |   if(N%f==0)cout << "Yes" << endl;
      |             ^~~~
      |             std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:14:30: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   14 |   if(N%f==0)cout << "Yes" << endl;
      |                              ^~~~
      |                              std::endl
In file included from /usr/include/c++/14/istream:41,
                 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:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:15:8: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   15 |   else cout << "No" << endl;
      |        ^~~~
      |        std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:15:24: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   15 |   else cout << "No" << endl;
      |                        ^~~~
      |                        std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main()
{
	int N;
	int quotient;
	int remainder;
	string answer = "No";

	cin >> N;

	tempSum = 0;
	quotient = N;
		
	// 各桁の和を求める
	while ( quotient > 0 ) {
		remainder = quotient % 10;
		tempSum += remainder;
		quotient /= 10;
	}
		
	if ( tempSum % N == 0 ) {
		answer = "Yes";
	}

	cout << answer << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:9: error: 'tempSum' was not declared in this scope; did you mean 'tempnam'?
   13 |         tempSum = 0;
      |         ^~~~~~~
      |         tempnam
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main()
{
	int N;
	int quotient;
	int remainder;
	int tempSum;
	char answer = 'No';

	cin >> N;

	tempSum = 0;
	quotient = i;
		
	// 各桁の和を求める
	while ( quotient > 0 ) {
		remainder = quotient % 10;
		tempSum += remainder;
		quotient /= 10;
	}
		
	if ( tempSum % N == 0 ) {
		answer = 'Yes';
	}

	cout << answer << endl;
	return 0;
}

Compiler output:
a.cc:10:23: warning: multi-character character constant [-Wmultichar]
   10 |         char answer = 'No';
      |                       ^~~~
a.cc:25:26: warning: multi-character character constant [-Wmultichar]
   25 |                 answer = 'Yes';
      |                          ^~~~~
a.cc: In function 'int main()':
a.cc:10:23: warning: overflow in conversion from 'int' to 'char' changes value from '20079' to '111' [-Woverflow]
   10 |         char answer = 'No';
      |                       ^~~~
a.cc:15:20: error: 'i' was not declared in this scope
   15 |         quotient = i;
      |                    ^
a.cc:25:26: warning: overflow in conversion from 'int' to 'char' changes value from '5858675' to '115' [-Woverflow]
   25 |                 answer = 'Yes';
      |                          ^~~~~
Language: C++

N = input()

def digitsum(n):
    a = list(map(int,n))
    b = sum(a)
    return b

if (int(N)%digitsum(N)) == 0:
    print("Yes")
else:
    print("No")

Compiler output:
a.cc:1:1: error: 'N' does not name a type
    1 | N = input()
      | ^
Language: C++

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

int main() {

int A,B=0,k;
  cin>>A;
  string a=to_string(A);
  for(int i=0;i<a.size();i++){k=atoi(a.at(i)).c_str();)
    B+=k;}
  if(A%B==0){cout<<"Yes"<<endl;}
  else{cout<<"No"<<endl;}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:42: error: invalid conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const char*' [-fpermissive]
    9 |   for(int i=0;i<a.size();i++){k=atoi(a.at(i)).c_str();)
      |                                      ~~~~^~~
      |                                          |
      |                                          __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)
      |                  ~~~~~~~~~~~~^~~~~~
a.cc:9:47: error: request for member 'c_str' in 'atoi(((const char*)((long int)a.std::__cxx11::basic_string<char>::at(((std::__cxx11::basic_string<char>::size_type)i)))))', which is of non-class type 'int'
    9 |   for(int i=0;i<a.size();i++){k=atoi(a.at(i)).c_str();)
      |                                               ^~~~~
a.cc:9:55: error: expected primary-expression before ')' token
    9 |   for(int i=0;i<a.size();i++){k=atoi(a.at(i)).c_str();)
      |                                                       ^
Language: C++

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

int main() {

int A,B=0,k;
  cin>>A;
  string a=to_string(A);
  for(int i=0;i<a.size();i++){k=atoi(a.at(i));)
    B+=k;}
  if(A%B==0){cout<<"Yes"<<endl;}
  else{cout<<"No"<<endl;}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:42: error: invalid conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const char*' [-fpermissive]
    9 |   for(int i=0;i<a.size();i++){k=atoi(a.at(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)
      |                  ~~~~~~~~~~~~^~~~~~
a.cc:9:47: error: expected primary-expression before ')' token
    9 |   for(int i=0;i<a.size();i++){k=atoi(a.at(i));)
      |                                               ^
Language: C++

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

int main() {

int A,B=0,k;
  cin>>A;
  string a=to_string(A);
  for(int i=0;i<a.size();i++){k=atoi(a.at(i);)
    B+=k;}
  if(A%B==0){cout<<"Yes"<<endl;}
  else{cout<<"No"<<endl;}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:45: error: expected ')' before ';' token
    9 |   for(int i=0;i<a.size();i++){k=atoi(a.at(i);)
      |                                     ~       ^
      |                                             )
a.cc:9:46: error: expected primary-expression before ')' token
    9 |   for(int i=0;i<a.size();i++){k=atoi(a.at(i);)
      |                                              ^
Language: C++

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

int main() {

int A,B=0;
  cin>>A;
  string a=to_string(A);
  for(int i=0;i<a.size();i++){
    B+=A.at(i);}
  if(A%B==0){cout<<"Yes"<<endl;}
  else{cout<<"No"<<endl;}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:10: error: request for member 'at' in 'A', which is of non-class type 'int'
   10 |     B+=A.at(i);}
      |          ^~
Language: C++

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

int main() {

int A,B=0;
  cin>>A;
  string a=to_string(A);
  for(int i=0;i<a.size();i++){
    B+=s.at(i);}
  if(A%B==0){cout<<"Yes"<<endl;}
  else{cout<<"No"<<endl;}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:8: error: 's' was not declared in this scope
   10 |     B+=s.at(i);}
      |        ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=(int)a;i<(int)b;++i)
int main(){
  string s;cin>>s;
  int x=stoi(s);
  int a=0;
  rep(i,s.size())a+=atoi(s[i]);
  if(x%a==0)cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:25: error: invalid conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const char*' [-fpermissive]
   10 |   rep(i,s.size())a+=atoi(s[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, num, sum;
  cin >> N;
  num = N;
  sum = 0;
  for(int i=0; 0<num; i++){
    int Si;
    Si = num%10;
    sum += Si;
    num /= 10;
  }
  
  if(N%sum == 0){
    cout << "Yes" << endl;
  }
  else{
    cout << "No" << endl;
  }
  

Compiler output:
a.cc: In function 'int main()':
a.cc:21:4: error: expected '}' at end of input
   21 |   }
      |    ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int N,digit,tmp,sum = 0;
  cin>>N;
  tmp=N;
  digit=log10(N);
  for(i=digit;i>=0;i--){
    int num;
    num = int(tmp/pow(10,i));
    sum+=num;
    tmp-=num*pow(10,i);
  }
  N%sum ? cout<<"No"<<endl : cout<<"Yes"<<endl;
}

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

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

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

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:11:19: error: expected ';' before 'j'
   11 |     k = N / x * 10
      |                   ^
      |                   ;
   12 |     j += N / x - k
      |     ~
Language: C++

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

int main() {
  int a;
  cin >> a;

  int sum;
  for (int i = 0; i < 8; i++) {
    num = a % 10;
    sum += num;
    num / 10;
  }

  if ( sum % a == 0 ) {
    cout << "yes" << endl;
  } else {
    cout << "No" << endl;
  }

}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: 'num' was not declared in this scope; did you mean 'sum'?
   10 |     num = a % 10;
      |     ^~~
      |     sum
Language: C++

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

int main (){
  int N;
  int j = 10;
  int hash = 0;
  cin >> N;
  int M = N;
  
  while (M != 0) {
    
    int a = M % j;
    M -= a;
    hash += a;
      
  }
  
  if (N % hash == 0){
    cout << "Yes" << ednl;
  }
  else{
    cout << "No" << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:22: error: 'ednl' was not declared in this scope
   20 |     cout << "Yes" << ednl;
      |                      ^~~~
Language: C++

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

int main (){
  int N;
  int j = 10;
  int hash = 0;
  cin >> N;
  int M = N;
  
  while (M != 0) {
    
    int a = M % j;
    M -= a;
    hash += a
      
  }
  
  if (N % hash == 0){
    cout << "Yes" << ednl;
  }
  else{
    cout << "No" << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:14: error: expected ';' before '}' token
   15 |     hash += a
      |              ^
      |              ;
   16 | 
   17 |   }
      |   ~           
a.cc:20:22: error: 'ednl' was not declared in this scope
   20 |     cout << "Yes" << ednl;
      |                      ^~~~
Language: C++

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

int main (){
  int N;
  int j = 10;
  int hash = 0;
  cin >> N;
  int M = N;
  
  while (M != 0) {
    
    a = M % j;
    M -= a;
    hash += a
      
  }
  
  if (N % hash == 0){
    cout << "Yes" << ednl;
  }
  else{
    cout << "No" << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:5: error: 'a' was not declared in this scope
   13 |     a = M % j;
      |     ^
a.cc:20:22: error: 'ednl' was not declared in this scope
   20 |     cout << "Yes" << ednl;
      |                      ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main(){
  
  int N;
  cin >> N;
  ostringstream stream;
  stream << N;
  string strN= stream.str();
  
  int Nsum=0;
  for(int i=0; i< strN.size(); i++){
  	Nsum +=strN[i];
  }
  
  if(N%Nsum==0) cout << Yes << endl;
  else cout << No << endl;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:25: error: 'Yes' was not declared in this scope
   17 |   if(N%Nsum==0) cout << Yes << endl;
      |                         ^~~
a.cc:18:16: error: 'No' was not declared in this scope; did you mean 'N'?
   18 |   else cout << No << endl;
      |                ^~
      |                N
Language: C++

#include<iostream>
   int sum_of_digit(int n){
      int sum=0;
      while(n>0){
       	sum += n%10;
  		n /= 10;
  	  }
	  return sum;
	}
int main(void){ 
  int n;
  cin >> n;
  if(sum_of_digit(n)%n==0){
  	cout << "Yes";
  }else{
  	cout << "No";
  }
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   12 |   cin >> n;
      |   ^~~
      |   std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:14:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   14 |         cout << "Yes";
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:16:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   16 |         cout << "No";
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

#include<iostream>
   int sum_of_digit(int n){
      int sum=0;
      while(n>0){
       	sum += n%10;
  		n /= 10;
  	  }
	  return sum;
	}
int main(void){ 
  int n;
  cin >> n;
  if(sum_of_digit(n)%3==0){
  	cout << "Yes";
  }else{
  	cout << "No";
  }
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   12 |   cin >> n;
      |   ^~~
      |   std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:14:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   14 |         cout << "Yes";
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:16:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   16 |         cout << "No";
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

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

int main(void) {
	int N;
	cin >> N;
	int S = func(N);
	if (N % S == 0) {
		cout << "Yes" << endl;
	} else {
		cout << "No" << endl;
	}
	return 0;
}


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

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

int main(void) {
	int N;
	cin >> N;
	int S = func(N);
	if (S % N == 0) {
		cout << "Yes" << endl
	} else {
		cout << "No" << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:17: error: 'func' was not declared in this scope
    7 |         int S = func(N);
      |                 ^~~~
a.cc:9:38: error: expected ';' before '}' token
    9 |                 cout << "Yes" << endl
      |                                      ^
      |                                      ;
   10 |         } else {
      |         ~
Language: C++

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

int main(void) {
	int N;
	cin >> N;
	int S = func(N);
	if (N % S == 0) {
		cout << "Yes" << endl
	} else {
		cout << "No" << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:17: error: 'func' was not declared in this scope
    7 |         int S = func(N);
      |                 ^~~~
a.cc:9:38: error: expected ';' before '}' token
    9 |                 cout << "Yes" << endl
      |                                      ^
      |                                      ;
   10 |         } else {
      |         ~
Language: C++

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

int main() {
  string s;
  int i;
  int n=0;
  
  cin >> s;
  for(i=0;i<8;i++){
    n+=stoi(s[i]);
  }
  cout << (stoi(s)%n==0 ? "Yes" : "No") << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:12: error: no matching function for call to 'stoi(__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type&)'
   11 |     n+=stoi(s[i]);
      |        ~~~~^~~~~~
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 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)
      |        ~~~~~~~~~~~~~~~^~~~~
Language: C++

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

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

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

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

int main() {
  int N,M,fn;
  cin>>N;
  M=N
  fn=0
  while(M>0){
    int a;
    a=M%10;
    fn+=a;
    M=(M-a)/10;
  }
  if(N%fn==0){cout<<"Yes"<<endl;}
  else{cout<<"No"<<endl;}
}



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

import java.util.*;

public class Main4 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String prm = sc.nextLine();
        int sum = 0;
        for (int i = 0; i < prm.length();) {
            char currentDegit = prm.charAt(i);
            int intCurrentDegit = Character.getNumericValue(currentDegit);
            sum += intCurrentDegit;
            i++;
        };
        
        if (Integer.parseInt(prm) % sum == 0) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
        
    }
}

Compiler output:
Main.java:3: error: class Main4 is public, should be declared in a file named Main4.java
public class Main4 {
       ^
1 error
Language: Java

package com.mec.sample;

import java.util.*;

public class Main4 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String prm = sc.nextLine();
        int sum = 0;
        for (int i = 0; i < prm.length();) {
            char currentDegit = prm.charAt(i);
            int intCurrentDegit = Character.getNumericValue(currentDegit);
            sum += intCurrentDegit;
            i++;
        };
        
        if (Integer.parseInt(prm) % sum == 0) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
        
    }
}

Compiler output:
Main.java:5: error: class Main4 is public, should be declared in a file named Main4.java
public class Main4 {
       ^
1 error
Language: Java


import java.util.*;

public class Main4 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String prm = sc.nextLine();
        int sum = 0;
        for (int i = 0; i < prm.length();) {
            char currentDegit = prm.charAt(i);
            int intCurrentDegit = Character.getNumericValue(currentDegit);
            sum += intCurrentDegit;
            i++;
        };
        
        if (sum % Integer.parseInt(prm) / sum == 0) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
        
    }
}

Compiler output:
Main.java:4: error: class Main4 is public, should be declared in a file named Main4.java
public class Main4 {
       ^
1 error
Language: C++

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

int main() {
	int a;
    cin >> a;
    
    int tmpA = a;
    int modNum = 0;
   	while(tmpA > 0) {
    	modNum += tmpA % 10;
        tempA /= 10;
    }
    
    string ans = "Yes";
    if(modNum == 0 || (a % modNum != 0)) {
		ans = "No";
    }
    cout << ans << endl;
}


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

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

int main() {
	int a;
    cin >> a;
    
    int tmpA = a;
    int modNum = 0;
   	while(tmpA > 0) {
    	modNum += tempA % 10;
        tempA /= 10;
    }
    
    string ans = "Yes";
    if(modNum == 0 || (a % modNum != 0)) {
		ans = "No";
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:19: error: 'tempA' was not declared in this scope; did you mean 'tmpA'?
   11 |         modNum += tempA % 10;
      |                   ^~~~~
      |                   tmpA
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:11:14: error: invalid conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const char*' [-fpermissive]
   11 |     f += atoi(s[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,p;
  cin >> N;
  p=0;
  while(N<a){
    p += (((N%10*a)-(N%a))%a);
    a *= 10;
  }
  
  if(N%p==0){
    cout << "Yes";
  }else{
    cout << "No";
  }
   
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:11: error: 'a' was not declared in this scope
    8 |   while(N<a){
      |           ^
Language: C++

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

int main() {
  int N,a,p;
  cin >>N;
  a=1;
  p=0;
  while(N<a){
    p += ((N%(10*a))-(N%a))/(10*a);
    a=10*a
  }
  if((N%p)==0){
    cout << "Yes";
  }else{
    cout << "No";
  }
}


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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: expected primary-expression before '=' token
   11 |     X + = tmp % 10;
      |         ^
Language: C++

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

int main() {
  int sum=0;
  int N,n;
  cin>>N;
  n=N;
  for(int i=7; i>=0;i--){
    int x=std::pow(10,i);
    sum=sum+/x;
    n=n-(n/x)*x;
  }
  if(sum%N==0){
    cout<<"Yes"<<endl;
  }
  else{
    cout<<"No"<<endl;
  }
}  



Compiler output:
a.cc: In function 'int main()':
a.cc:14:13: error: expected primary-expression before '/' token
   14 |     sum=sum+/x;
      |             ^
Language: C++

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

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



Compiler output:
a.cc: In function 'int main()':
a.cc:11:13: error: expected primary-expression before '/' token
   11 |     sum=sum+/x;
      |             ^
Language: C++

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

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



Compiler output:
a.cc: In function 'int main()':
a.cc:11:13: error: expected primary-expression before '/' token
   11 |     sum=sum+/x;
      |             ^
a.cc:14:9: error: lvalue required as left operand of assignment
   14 |   if(sum%N=0){
      |      ~~~^~
Language: C++

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

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



Compiler output:
a.cc: In function 'int main()':
a.cc:11:13: error: expected primary-expression before '/' token
   11 |     sum=sum+/x;
      |             ^
a.cc:14:9: error: lvalue required as left operand of assignment
   14 |   if(sum%n=0){
      |      ~~~^~
Language: C++

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

int main() {
  int sum=0;
  for(int i=7; i>=0;i--){
    sum=sum+N%(10*i);
    N=N-N%(10*i);
  }
  cout<<sum<<endl;
}  



Compiler output:
a.cc: In function 'int main()':
a.cc:7:13: error: 'N' was not declared in this scope
    7 |     sum=sum+N%(10*i);
      |             ^
Language: C++

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

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


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

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

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


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

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

int main(){
  int a,s,d,f;
  cin >> a;
  s = a[0]+a[1]+a[2]+a[3]+a[4]+a[5]+a[6]+a[7]+a[8];
	cout << ( a%s=0:"Yes":"No") << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:8: error: invalid types 'int[int]' for array subscript
    7 |   s = a[0]+a[1]+a[2]+a[3]+a[4]+a[5]+a[6]+a[7]+a[8];
      |        ^
a.cc:7:13: error: invalid types 'int[int]' for array subscript
    7 |   s = a[0]+a[1]+a[2]+a[3]+a[4]+a[5]+a[6]+a[7]+a[8];
      |             ^
a.cc:7:18: error: invalid types 'int[int]' for array subscript
    7 |   s = a[0]+a[1]+a[2]+a[3]+a[4]+a[5]+a[6]+a[7]+a[8];
      |                  ^
a.cc:7:23: error: invalid types 'int[int]' for array subscript
    7 |   s = a[0]+a[1]+a[2]+a[3]+a[4]+a[5]+a[6]+a[7]+a[8];
      |                       ^
a.cc:7:28: error: invalid types 'int[int]' for array subscript
    7 |   s = a[0]+a[1]+a[2]+a[3]+a[4]+a[5]+a[6]+a[7]+a[8];
      |                            ^
a.cc:7:33: error: invalid types 'int[int]' for array subscript
    7 |   s = a[0]+a[1]+a[2]+a[3]+a[4]+a[5]+a[6]+a[7]+a[8];
      |                                 ^
a.cc:7:38: error: invalid types 'int[int]' for array subscript
    7 |   s = a[0]+a[1]+a[2]+a[3]+a[4]+a[5]+a[6]+a[7]+a[8];
      |                                      ^
a.cc:7:43: error: invalid types 'int[int]' for array subscript
    7 |   s = a[0]+a[1]+a[2]+a[3]+a[4]+a[5]+a[6]+a[7]+a[8];
      |                                           ^
a.cc:7:48: error: invalid types 'int[int]' for array subscript
    7 |   s = a[0]+a[1]+a[2]+a[3]+a[4]+a[5]+a[6]+a[7]+a[8];
      |                                                ^
a.cc:8:20: error: lvalue required as left operand of assignment
    8 |         cout << ( a%s=0:"Yes":"No") << endl;
      |                   ~^~
a.cc:8:24: error: expected ')' before ':' token
    8 |         cout << ( a%s=0:"Yes":"No") << endl;
      |                 ~      ^
      |                        )
Language: C++

#include <iostream>
using namespace std;

bool is_harshad(int x, int fx) {
    if (x % fx == 0) return true;
    else return false;
}

int main() {
    int n; cin >> n;
    int x = n;
    int fx = 0;

    while(x) {
        fx = x % 10;
        x /= 10;
    }

    if (is_harshad(n, fx)) cout << "Yes" << endl;
    else cout << "No"

Compiler output:
a.cc: In function 'int main()':
a.cc:20:22: error: expected ';' at end of input
   20 |     else cout << "No"
      |                      ^
      |                      ;
a.cc:20:22: error: expected '}' at end of input
a.cc:9:12: note: to match this '{'
    9 | int main() {
      |            ^
Language: C++

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

int main() {
int N;
  cin >> N;
  if (N / 10 <= 10){
    if (N % ((N / 10) + (N % 10)) == 0){
      cout << "Yes" << endl;
    }
    else {
      cout << "Yes" << endl;
    }
  }
    
  
  

Compiler output:
a.cc: In function 'int main()':
a.cc:14:4: error: expected '}' at end of input
   14 |   }
      |    ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: lvalue required as left operand of assignment
    8 |   N / 10 = t;
      |   ~~^~~~
a.cc:9:5: error: lvalue required as left operand of assignment
    9 |   N % 10 = c;
      |   ~~^~~~
a.cc:10:9: error: lvalue required as left operand of assignment
   10 |   if (N % (t + c) = 0){
      |       ~~^~~~~~~~~
Language: C++

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

int main() {
  int N;
  cin >> N;
  
  int total = 0;
  for (double i = 0; i < 8; i++) {
    int diff = (N % pow(10., i + 1)) - (N % pow(10., i));
    total += diff / pow(10., i);
  }
  
  if ((N % total) == 0) {
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:19: error: invalid operands of types 'int' and 'double' to binary 'operator%'
   10 |     int diff = (N % pow(10., i + 1)) - (N % pow(10., i));
      |                 ~ ^ ~~~~~~~~~~~~~~~
      |                 |      |
      |                 int    double
a.cc:10:43: error: invalid operands of types 'int' and 'double' to binary 'operator%'
   10 |     int diff = (N % pow(10., i + 1)) - (N % pow(10., i));
      |                                         ~ ^ ~~~~~~~~~~~
      |                                         |      |
      |                                         int    double
Language: C++

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

int main() {
  int N;
  cin >> N;
  
  int total = 0;
  for (int i = 0; i < 8; i++) {
    int diff = (N % pow(10, i + 1)) - (N % pow(10, i));
    total += diff / pow(10, i);
  }
  
  if ((N % total) == 0) {
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
}

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

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

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

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

#include<stdio.h>
#include <string.h>
int main(){
    char x[10000000];
    int t, c[1000000];
    scanf("%s", x);
    t = strlen(x);
    for(int i = 0; i < t; i++){
        sscanf(x[i], "%d", &c[i])
    }
    return 0;
    }


Compiler output:
main.c: In function 'main':
main.c:9:17: error: passing argument 1 of 'sscanf' makes pointer from integer without a cast [-Wint-conversion]
    9 |         sscanf(x[i], "%d", &c[i])
      |                ~^~~
      |                 |
      |                 char
In file included from main.c:1:
/usr/include/stdio.h:430:43: note: expected 'const char *' but argument is of type 'char'
  430 | extern int sscanf (const char *__restrict __s,
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~
main.c:9:34: error: expected ';' before '}' token
    9 |         sscanf(x[i], "%d", &c[i])
      |                                  ^
      |                                  ;
   10 |     }
      |     ~