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

#include <bits/stdc++.h>
#include<algorithm>
using namespace std;
 
template <class T> using V = vector<T>;
 
using ll = long long;
using db = double;
using st = string;
using ch = char;
using vll = V<ll>;
using vpll =V<pair<ll,ll>>;
using vst = V<st>;
using vdb = V<db>;
using vch = V<ch>;
 
 
#define FOR(i,a,b) for(ll i=(a);i<(ll)(b);i++)
#define rFOR(i,a,b) for(ll i=(b);i>(ll)(a);i--)
#define oFOR(i,a,b) for(ll i=(a);i<(ll)(b);i+=2)
#define bgn begin()
#define en end()
#define SORT(a) sort((a).bgn,(a).en)
#define REV(a) reverse((a).bgn,(a).en)
#define M(a,b) max(a,b)
#define rM(a,b) min(a,b)
#define fi first
#define se second
#define sz size()
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) __lcm(a,b)
#define co(a) cout<<a<<endl;
#define ci(a) cin>>a;
 
 
ll sum(ll n) {
  ll m=0;
  FOR(i,0,12){
    m+=n%10;
    n/=10;
  }
  return m;
}
 
 
/****************************************\
| Thank you for viewing my code:)        |
| Written by RedSpica a.k.a. RanseMirage |
| Twitter:@asakaakasaka                  | 
\****************************************/
 
 
signed main() {
  ll n;
  	ci(n);
  if(n%sum(n)==0){
    co("Yes")
  }
  else{
    co"No")
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:60:5: error: 'co' was not declared in this scope
   60 |     co"No")
      |     ^~
Language: C++

#include<iostream>
#include <math.h>
#include <algorithm>
#include<queue>
#include <bits/stdc++.h>


using namespace std;

#define FOR(i,a,b) for(int i=(a),i##formax=(b);i<i##formax;i++)

main(){
    string N;
    long sum = 0;
    cin >> N;
    FOR(i, 0, (int)(N.length())){
        sum += (int)(N[i]);
    }
    if(sum % (int)(N)){ cout << "Yes" << endl;}
    else {cout << No << endl;}
}

Compiler output:
a.cc:12:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   12 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:19:14: error: invalid cast from type 'std::string' {aka 'std::__cxx11::basic_string<char>'} to type 'int'
   19 |     if(sum % (int)(N)){ cout << "Yes" << endl;}
      |              ^~~~~~~~
a.cc:20:19: error: 'No' was not declared in this scope; did you mean 'N'?
   20 |     else {cout << No << endl;}
      |                   ^~
      |                   N
Language: C++

#include<iostream>
#include <math.h>
#include <algorithm>
#include<queue>
#include <bits/stdc++.h>


using namespace std;

#define FOR(i,a,b) for(int i=(a),i##formax=(b);i<i##formax;i++)

main(){
    string N;
    int long = 0;
    cin >> N;
    FOR(i, 0, (int)(N.length())){
        sum += (int)(N[i]);
    }
    if(sum % (int)(N)){ cont << "Yes" << endl;}
    else {cout << No << endl;}
}

Compiler output:
a.cc:12:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   12 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:14:14: error: expected unqualified-id before '=' token
   14 |     int long = 0;
      |              ^
a.cc:17:9: error: 'sum' was not declared in this scope
   17 |         sum += (int)(N[i]);
      |         ^~~
a.cc:19:8: error: 'sum' was not declared in this scope
   19 |     if(sum % (int)(N)){ cont << "Yes" << endl;}
      |        ^~~
a.cc:19:14: error: invalid cast from type 'std::string' {aka 'std::__cxx11::basic_string<char>'} to type 'int'
   19 |     if(sum % (int)(N)){ cont << "Yes" << endl;}
      |              ^~~~~~~~
a.cc:19:25: error: 'cont' was not declared in this scope; did you mean 'const'?
   19 |     if(sum % (int)(N)){ cont << "Yes" << endl;}
      |                         ^~~~
      |                         const
a.cc:20:19: error: 'No' was not declared in this scope; did you mean 'N'?
   20 |     else {cout << No << endl;}
      |                   ^~
      |                   N
Language: C++

#include<iostream>
#include <math.h>
#include <algorithm>
#include<queue>
#include <bits/stdc++.h>


using namespace std;

#define FOR(i,a,b) for(int i=(a),i##formax=(b);i<i##formax;i++)

main(){
    string N;
    int sum = 0;
    cin >> N;
    FOR(i, 0, (int)(N.length()){
        sum += (int)(N[i]);
    }
    if(sum % (int)(N)){ cont << "Yes" << endl;}
    else {cout << No << endl;}
}

Compiler output:
a.cc:21:2: error: unterminated argument list invoking macro "FOR"
   21 | }
      |  ^
a.cc:12:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   12 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:16:5: error: 'FOR' was not declared in this scope
   16 |     FOR(i, 0, (int)(N.length()){
      |     ^~~
a.cc:16:8: error: expected '}' at end of input
   16 |     FOR(i, 0, (int)(N.length()){
      |        ^
a.cc:12:7: note: to match this '{'
   12 | main(){
      |       ^
Language: C++

#include<iostream>
#include <math.h>
#include <algorithm>
#include<queue>
#include <bits/stdc++.h>


using namespace std;

#define FOR(i,a,b) for(int i=(a),i##formax=(b);i<i##formax;i++)

main(){
    string N;
    int sum = 0;
    cin >> N;
    FOR(i, 0, (int)(N.length()){
        sum += (int)(N[i]);
    }
    if(sum % (int)(N)) cont << "Yes" << endl;
    else cout << No << endl;
}

Compiler output:
a.cc:21:2: error: unterminated argument list invoking macro "FOR"
   21 | }
      |  ^
a.cc:12:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   12 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:16:5: error: 'FOR' was not declared in this scope
   16 |     FOR(i, 0, (int)(N.length()){
      |     ^~~
a.cc:16:8: error: expected '}' at end of input
   16 |     FOR(i, 0, (int)(N.length()){
      |        ^
a.cc:12:7: note: to match this '{'
   12 | main(){
      |       ^
Language: C++

#include <iostream>
#include <vector>
#include <stack>
#include <queue>
#include <string>
#include <algorithm>
#include <math.h>
#include <map>
#include <numeric>
#include <bitset>
using namespace std;
#define lint long long
#define ll long long
#define pq priority_queue
#define mp make_pair
#define vl vector<long long>
long long INF = 1e10;
#define pii pair<long long,long long>
#define all(x) (x).begin(),(x).end()
#define mod 1000000007
/******************************define**********************************/
ll pow10(ll x){
    if( x == 0) return 1;
    else pow10(x - 1) * 10;
}
ll atoi(string S){
    ll l = S.size();
    ll ans = 0;
    for(ll i = 0;i < l;i++){
        ans += pow10(i) * (S[i] - '0');
    }
    return ans;
}

/*****************************functions********************************/

/****************************main function*****************************/
int main(void){
    string N; cin >> N;
    ll n = atoi(N);
    ll m = 0;
    for(int i = 0;i < N.size();i++) m += S[i] - '0';
    if(n %m == 0){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:42:42: error: 'S' was not declared in this scope
   42 |     for(int i = 0;i < N.size();i++) m += S[i] - '0';
      |                                          ^
a.cc: In function 'long long int pow10(long long int)':
a.cc:24:15: warning: control reaches end of non-void function [-Wreturn-type]
   24 |     else pow10(x - 1) * 10;
      |          ~~~~~^~~~~~~
Language: C++

#include <iostream>
#include <vector>
#include <stack>
#include <queue>
#include <string>
#include <algorithm>
#include <math.h>
#include <map>
#include <numeric>
#include <bitset>
using namespace std;
#define lint long long
#define ll long long
#define pq priority_queue
#define mp make_pair
#define vl vector<long long>
long long INF = 1e10;
#define pii pair<long long,long long>
#define all(x) (x).begin(),(x).end()
#define mod 1000000007
/******************************define**********************************/
ll pow10(int x){
    if( x == 0) return 1;
    else pow10(x - 1) * 10;
}
ll atoi(string S){
    ll l = S.size();
    ll ans = 0;
    for(ll i = 0;i < l;i++){
        ans += pow10(i) * (S[i] - '0');
    }
    return ans;
}

/*****************************functions********************************/

/****************************main function*****************************/
int main(void){
    string N; cin >> N;
    ll n = atoi(N);
    ll m = 0;
    for(int i = 0;i < N.size();i++) m += S[i] - '0';
    if(n %m == 0){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:42:42: error: 'S' was not declared in this scope
   42 |     for(int i = 0;i < N.size();i++) m += S[i] - '0';
      |                                          ^
a.cc: In function 'long long int pow10(int)':
a.cc:24:15: warning: control reaches end of non-void function [-Wreturn-type]
   24 |     else pow10(x - 1) * 10;
      |          ~~~~~^~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
 
int main(){
  string N;
  cin >> N;
  int SN,NN;
  SN = atoi(N.c_str());
  NN = atoi(N[0].c_str())+atoi(N[1].c_str())+atoi(N[2].c_str());

  


  if( SN % NN== 0){
      cout <<"Yes"<<endl;
      return 0;
  }
  cout <<"No" <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:18: error: request for member 'c_str' in 'N.std::__cxx11::basic_string<char>::operator[](0)', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}
    9 |   NN = atoi(N[0].c_str())+atoi(N[1].c_str())+atoi(N[2].c_str());
      |                  ^~~~~
a.cc:9:37: error: request for member 'c_str' in 'N.std::__cxx11::basic_string<char>::operator[](1)', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}
    9 |   NN = atoi(N[0].c_str())+atoi(N[1].c_str())+atoi(N[2].c_str());
      |                                     ^~~~~
a.cc:9:56: error: request for member 'c_str' in 'N.std::__cxx11::basic_string<char>::operator[](2)', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}
    9 |   NN = atoi(N[0].c_str())+atoi(N[1].c_str())+atoi(N[2].c_str());
      |                                                        ^~~~~
Language: C

#include <stdio.h>

int main(void){
  int n, m, s;
  m=10;
  scanf(%d,&n);
  for(int i=1;i<10;i++){
    s += n%m *10/m;
    m*=10
  }
  
  if(n%s==0){
    printf("yes");
  }else{
    printf("no")
  }
}

Compiler output:
main.c: In function 'main':
main.c:6:9: error: expected expression before '%' token
    6 |   scanf(%d,&n);
      |         ^
main.c:9:10: error: expected ';' before '}' token
    9 |     m*=10
      |          ^
      |          ;
   10 |   }
      |   ~       
main.c:15:17: error: expected ';' before '}' token
   15 |     printf("no")
      |                 ^
      |                 ;
   16 |   }
      |   ~
Language: C++

#include <bits/stdc++.h>
#include <iostream>
using namespace std;
int main() {
	//入力
	int n,s,k;
  	bool ans = false;
	cin >> n;
  	k=n;
	//処理
	for (int i = 1;i<11;i++){
    	s += k % 10^i;
        k = k % 10^(10-i);
    }
  	if (n%s==0) ans = true; 
	//出力
    if(ans){
	cout << Yes << endl;
    }
  	else{
  	cout << No << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:17: error: 'Yes' was not declared in this scope
   18 |         cout << Yes << endl;
      |                 ^~~
a.cc:21:17: error: 'No' was not declared in this scope
   21 |         cout << No << endl;
      |                 ^~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main() {
	int A,;
	cin >> A ;
    int D = A/1000000000+A/100000000/+A/10000000+A/1000000+A/100000+A/10000+A/1000+A/100+A/10+A%10;
    if(A%D=0)
		cout << "Yes" << endl;
  else cout<<"No"<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:4:15: error: expected unqualified-id before ';' token
    4 |         int A,;
      |               ^
a.cc:7:9: error: lvalue required as left operand of assignment
    7 |     if(A%D=0)
      |        ~^~
Language: C++

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

int main(){
  int n, s = 0;
  cin >> n;
  p = n;

  while(p > 0){
    s += p / 10;
    p / 10;
  }
  if(n % s == 0) cout << "Yes" << endl;
  
  else cout << "No" << endl;
}

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

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

int main(){
  string a;
  cin>>a;
int b,c,d;
  b=a.size();
  c=0;
  d=0;
  for(int i=0;i<b;i++){
  c=c*10+(a[i]-'0');
    d=d+(a[i]-'0')
  }
  
  if(c%d==0){
      cout<<"Yes"<<endl;
    }
else{
        cout<<"No"<<endl;
      }

}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:19: error: expected ';' before '}' token
   13 |     d=d+(a[i]-'0')
      |                   ^
      |                   ;
   14 |   }
      |   ~
Language: C++

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

int main(){
int a,b,ans;
cin>>a;
  for(int i=0;i<a;i++){
  if(a/(10**i)==0){
  b=i;
    break;
  }
  }
  vector<int>A(b+1);
  A[0]=0;
  ans=0;
  for(int i=1;i<b+1;i++){
    A[i]=a/(10**(b-i))-a/(10**(b-i+1))*10;
 ans+=A[i]
  }
      cout<<ans<<endl; 
     
   
 
 

}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:12: error: invalid type argument of unary '*' (have 'int')
    8 |   if(a/(10**i)==0){
      |            ^~
a.cc:17:16: error: invalid type argument of unary '*' (have 'int')
   17 |     A[i]=a/(10**(b-i))-a/(10**(b-i+1))*10;
      |                ^~~~~~
a.cc:17:30: error: invalid type argument of unary '*' (have 'int')
   17 |     A[i]=a/(10**(b-i))-a/(10**(b-i+1))*10;
      |                              ^~~~~~~~
a.cc:18:11: error: expected ';' before '}' token
   18 |  ans+=A[i]
      |           ^
      |           ;
   19 |   }
      |   ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  cin >> S;
  int s[S.size()];
  int ans = 0;
  for(int i = 0; i < S.size(); i++) {
    s[i] = stoi(S.substr(i, 1));
    ans += s[i];
  }
  cout << ((n % ans == 0) ? "Yes" : "No") << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:13: error: 'n' was not declared in this scope
   12 |   cout << ((n % ans == 0) ? "Yes" : "No") << endl;
      |             ^
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class AtcoderABC101B {
    public static void main(String[] args) throws IOException {
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(input.readLine());
        System.out.println(getSum(n) ? "Yes" : "No");
    }

    public static boolean getSum(int n){
        int copyN = n;
        int sum = 0;
        while (n > 9){
            sum += n % 10;
            n /= 10;
        }
        if (sum > 0)
            sum+= n;

        return copyN % sum == 0;
    }
}


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

#include <iostream>
#include <cstring>
#include <stdlib.h>
#include <vector>
#include <algorithm>
#include <cmath>
#include <stack>
#include <queue>
#include <math.h>
#include <string>

using namespace std;

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

    

    return 0;
}

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

#include<iostraem>
using namespace std;

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

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

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

//int main() {
  int a,cnt;cin >> a;
  cnt = 0;
  int n = 1000000000;

  for(int i=0;i<11;i++){
    cnt += a/n;
    if(a>n)a = a%10;
    n = n/10;
    if(n == 1){
      break;
    }
  }

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

Compiler output:
a.cc:5:13: error: 'cin' does not name a type
    5 |   int a,cnt;cin >> a;
      |             ^~~
a.cc:6:3: error: 'cnt' does not name a type; did you mean 'int'?
    6 |   cnt = 0;
      |   ^~~
      |   int
a.cc:9:3: error: expected unqualified-id before 'for'
    9 |   for(int i=0;i<11;i++){
      |   ^~~
a.cc:9:15: error: 'i' does not name a type
    9 |   for(int i=0;i<11;i++){
      |               ^
a.cc:9:20: error: 'i' does not name a type
    9 |   for(int i=0;i<11;i++){
      |                    ^
a.cc:18:3: error: expected unqualified-id before 'if'
   18 |   if(a%cnt==0){
      |   ^~
a.cc:20:4: error: expected unqualified-id before 'else'
   20 |   }else{
      |    ^~~~
a.cc:23:1: error: expected declaration before '}' token
   23 | }
      | ^
Language: C++

#include <iostream>
#include <string>
#include <cstring>
#include <cmath>
#include <cstdio>
#include <algorithm>
#define int long long
using namespace std;
int main(){
    int n;
    cin >> n;
    int s = 0;
    int ns = n;
    for (int i = 9; i >= 0; i--){
        s += ns/pow(10, i);
        ns -= ns/pow(10, i);
    }
    if (n % s == 0){
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
    return 0;
}


Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

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

int main(){
    int N;
    cin >> N;
    ostringstream ss;
    ss << N;
    string sn = ss.str();
    int sum = 0;
    for(int i = 0; i < sn.length(); i++){
        sum += stoi(sn[i]);
    }
    if(N % sum == 0) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:20: error: no matching function for call to 'stoi(__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type&)'
   12 |         sum += stoi(sn[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 N;
    cin >> N;
    int d = N;
    to_string(N);
    int sum = 0;
    for(int i = 0; i < N.length(); i++){
        sum += ctoi(N[i]);
    }
    if(d % sum == 0) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:14: warning: ignoring return value of 'std::string std::__cxx11::to_string(int)', declared with attribute 'nodiscard' [-Wunused-result]
    8 |     to_string(N);
      |     ~~~~~~~~~^~~
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:4240:3: note: declared here
 4240 |   to_string(int __val)
      |   ^~~~~~~~~
a.cc:10:26: error: request for member 'length' in 'N', which is of non-class type 'int'
   10 |     for(int i = 0; i < N.length(); i++){
      |                          ^~~~~~
a.cc:11:22: error: invalid types 'int[int]' for array subscript
   11 |         sum += ctoi(N[i]);
      |                      ^
a.cc:11:16: error: 'ctoi' was not declared in this scope; did you mean 'atoi'?
   11 |         sum += ctoi(N[i]);
      |                ^~~~
      |                atoi
Language: C++

#include<stdio.h>
#include<algorithm>

char n[1000000001] = { 0 };

int main() {
	
	////freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);

	scanf("%s", n);
	int sum = 0;
	int num = 0;
	for (int i = 0; i < strlen(n); i++) {
		sum += n[i]-'0';
		num *= 10;
		num += n[i] - '0';
	}
	if (num%sum == 0) {
		printf("Yes");
	}
	else {
		printf("No");
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:29: error: 'strlen' was not declared in this scope
   14 |         for (int i = 0; i < strlen(n); i++) {
      |                             ^~~~~~
a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include<algorithm>
  +++ |+#include <cstring>
    3 |
Language: Java

import java.util.*;

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


Compiler output:
Main.java:15: error: '(' expected
    else if
           ^
Main.java:16: error: ')' expected
      System.out.println("No");
                              ^
Main.java:15: error: 'else' without 'if'
    else if
    ^
3 errors
Language: Java

import java.util.*;

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


Compiler output:
Main.java:15: error: 'else' without 'if'
    else
    ^
1 error
Language: C++

#include <iostream>
#include <string>
using namespace std;

int main(){

    ios::sync_with_stdio(false);
    cin.tie(0);
    string n;
    cin >> n;
    int divnum = 0;
    int n_num = atoi(n.c_str())
    for(int i=0; i<n.length(); i++){
        divnum += (int)n[i];
    }

    if(n_num % divnum == 0){
        cout << "Yes" << endl;
    }

    else{
        cout << "No" << endl;
    }
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:5: error: expected ',' or ';' before 'for'
   13 |     for(int i=0; i<n.length(); i++){
      |     ^~~
a.cc:13:18: error: 'i' was not declared in this scope
   13 |     for(int i=0; i<n.length(); i++){
      |                  ^
Language: C

#include <stdio.h>
#include <stdlib.h>
int main(void){
char s[15];
  int sum;
  int a;
  scanf("%s",s);
  for(count=0;s[count]!='\0';count++){
 sum=sum+atoi(s[count]);
  }
  a=atoi(s);
  if(a%sum==0){printf("Yes");}
  else {printf("No");}
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:7: error: 'count' undeclared (first use in this function)
    8 |   for(count=0;s[count]!='\0';count++){
      |       ^~~~~
main.c:8:7: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

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

int main (){
  int func(int x){
    if(x<10){
      return x;
    }
    else{
      return x%10+func(x/10);
    }
  }
  int n;
  cin >> n;
  int s=func(n);
  if(n%s==0){
    cout << "Yes" << endl;
  }
  else{
    cout << "No" << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:18: error: a function-definition is not allowed here before '{' token
    5 |   int func(int x){
      |                  ^
a.cc:15:9: error: 'func' was not declared in this scope
   15 |   int s=func(n);
      |         ^~~~
Language: C++

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

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


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

#include <bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin >> n;
    int t = 0;
    int a = n;
    while(a / 10 != 0)
    {
        t += a % 10;
        a /= 10;
    }
    t += a % 10;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:18:13: error: expected ';' before string constant
   18 |         cout "Yes" << endl;
      |             ^~~~~~
      |             ;
Language: Java

import java.util.Scanner;
public class Main{
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int N;
		int Z;
		N = scanner.nextInt();
		N = Z;
		int ans = 0;
		while(N > 0){
			ans += N % 10;
			N /= 10;
		}
		if (Z % ans == 0){
			System.out.println("Yes");
		}else{
			System.out.println("No");
		}
	}
}

Compiler output:
Main.java:8: error: variable Z might not have been initialized
		N = Z;
		    ^
1 error
Language: Java

import java.util.Scanner;

public class Main{
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        String ans;

        if(n % s(n) == 0)ans = "Yes";
        else ans = "No";
        
        System.out.println(ans);
    }

    public static int S(int n){
        int ans = 0;
        while(n > 0){
            ans += n % 10;
            n /= 10;
        }

        return ans;
    }
}

Compiler output:
Main.java:9: error: cannot find symbol
        if(n % s(n) == 0)ans = "Yes";
               ^
  symbol:   method s(int)
  location: class Main
1 error
Language: Java

import java.util.*;
 
public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.next();
    int M = N;
    int sum = 0;

    while(M!=0){
      sum+=M%10;
      M/=10;
    }
    if(N%sum==0){
      System.out.println("Yes");
    }
    else{
      System.out.println("No");
    }
  }
}

Compiler output:
Main.java:6: error: incompatible types: String cannot be converted to int
    int N = sc.next();
                   ^
1 error
Language: C

#include <stdio.h>

int main(){
    int n;
    int s=0;
    scanf("%d",&n);
    for(while n>0){
        s+=n%10;
        n/=10;
    }
    printf("%d",s);
    if(n%s==0) printf("Yes\n");
    else printf("No\n");
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:7:9: error: expected expression before 'while'
    7 |     for(while n>0){
      |         ^~~~~
main.c:7:18: error: expected expression before ')' token
    7 |     for(while n>0){
      |                  ^
Language: C

#include <stdio.h>
#include <math.h>
int main(){
    int n;
    int s=0;
    scanf("%d",&n);
    for(int i=0;i<log10((double)n)+1;i++){
        s+=n%10;
        n/=10;
    }
    printf("%d",s);
    if(n%s==0) printf("Yes\n");
    else printf("No\n");
    return 0;

Compiler output:
main.c: In function 'main':
main.c:14:5: error: expected declaration or statement at end of input
   14 |     return 0;
      |     ^~~~~~
Language: C++

#include <bits/stdc++.h>
#include <math.h>
using namespace std;
#define cinf(n,x) for(int i=0;i<(n);i++) cin >> x[i];

int main(){
  int N;
  cin >> N;
  int sum ;
  int n = N
  while(n>0){
    sum += n%10 ;
    n /= 10 ;
  }
  if(N % sum == 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(n>0){
      |   ^~~~~
Language: C++

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

string s;

int main(){
  cin >> s;
  int sn  = 0:
  int n = 0;
  for(int i=0;i<s.size();i++){
    sn += s[i]-'0';
    n = 10*n+(s[i]-'0');
  }
  if(n%sn!=0)cout<<"No"<<endl;
  else cout <<"Yes"<<endl
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:14: error: expected ',' or ';' before ':' token
    8 |   int sn  = 0:
      |              ^
a.cc:12:5: error: 'n' was not declared in this scope
   12 |     n = 10*n+(s[i]-'0');
      |     ^
a.cc:14:6: error: 'n' was not declared in this scope; did you mean 'sn'?
   14 |   if(n%sn!=0)cout<<"No"<<endl;
      |      ^
      |      sn
a.cc:15:26: error: expected ';' before 'return'
   15 |   else cout <<"Yes"<<endl
      |                          ^
      |                          ;
   16 |   return 0;
      |   ~~~~~~
Language: C++

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

string s;

int main(){
  cin >> s;
  int sn  = 0:
  int n
  for(int i=0;i<s.size();i++){
    sn += s[i]-'0';
    n = 10*n+(s[i]-'0');
  if(n%sn!=0)cout<<"No"<<endl;
  else cout <<"Yes"<<endl
  return 0


Compiler output:
a.cc: In function 'int main()':
a.cc:8:14: error: expected ',' or ';' before ':' token
    8 |   int sn  = 0:
      |              ^
a.cc:10:15: error: 'i' was not declared in this scope
   10 |   for(int i=0;i<s.size();i++){
      |               ^
a.cc:15:11: error: expected '}' at end of input
   15 |   return 0
      |           ^
a.cc:6:11: note: to match this '{'
    6 | int main(){
      |           ^
Language: C

#include<stdio.h>
#include<string.h>

int main(){
  int i,j,k=0;
  
  char N[];
  
  scanf("%s",N);
  
  for(i=;i<strlen(N);i++){
    k += (N[i] - '0');
  }
  
  j = atoi(N);
  
  if(j%k == 0)
    puts("Yes");
  
  else
    puts("No");
  
  return 0;
}
  
  

Compiler output:
main.c: In function 'main':
main.c:7:8: error: array size missing in 'N'
    7 |   char N[];
      |        ^
main.c:11:9: error: expected expression before ';' token
   11 |   for(i=;i<strlen(N);i++){
      |         ^
main.c:15:7: error: implicit declaration of function 'atoi' [-Wimplicit-function-declaration]
   15 |   j = atoi(N);
      |       ^~~~
Language: Java

import java.util.Scanner;

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

Compiler output:
Main.java:21: error: reached end of file while parsing
        }
         ^
1 error
Language: C++

#include<stdio.h>
#include<stdlib.h>

int getLength(char a[]);

int main(void){
    int i,len,sum=0;
    char num[15];
    gets(num);
    len=getLength(num);
    for(i=0;i<len;i++){
        sum+=num[i]-'0';    
    }
    if(atoi(num)%sum){
        puts("No");
        return 0;
    }else{
        puts("Yes");
        return 0;
    }
    
    return 0;
}
    
int getLength(char a[]){
    int i=0;
    while(a[i]){
        i++;
    }
    return i;
}

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


using namespace std;

int main(){

  int N, S = 0;

  cin >> N;

  int num = N;
  
  while(num){
    S += num % 10;
    num = num / 10;
  }

  if(N % S == 0){
    cout << "Yes\n";
  }
  else{
    cout << "No\n";
  }
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'cin' was not declared in this scope
    8 |   cin >> N;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | 
a.cc:18:5: error: 'cout' was not declared in this scope
   18 |     cout << "Yes\n";
      |     ^~~~
a.cc:18:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:21:5: error: 'cout' was not declared in this scope
   21 |     cout << "No\n";
      |     ^~~~
a.cc:21:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
	int a;
	cin>>a;
    int n[10];
    n[0]=n%10;
    for(int i=1;i<10;i++){
		n[i]=n/(10*(i+1))-n/(10*i);
	}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:11: error: invalid operands of types 'int [10]' and 'int' to binary 'operator%'
    7 |     n[0]=n%10;
      |          ~^~~
      |          | |
      |          | int
      |          int [10]
a.cc:9:23: error: invalid operands of types 'int [10]' and 'int' to binary 'operator/'
    9 |                 n[i]=n/(10*(i+1))-n/(10*i);
      |                      ~^~~~~~~~~~~
      |                      |    |
      |                      |    int
      |                      int [10]
a.cc:9:36: error: invalid operands of types 'int [10]' and 'int' to binary 'operator/'
    9 |                 n[i]=n/(10*(i+1))-n/(10*i);
      |                                   ~^~~~~~~
      |                                   |    |
      |                                   |    int
      |                                   int [10]
Language: C++

#include <iostream>
using namespace std;

int s( int n ){
  ans = 0;
  while ( n != 0 ){
    ans += n % 10;
    ans /= 10;
  }
  
  return ans;
}

int main(){
  int n;
  cin >> n;
  
  if ( n % s(n) == 0 )
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}

Compiler output:
a.cc: In function 'int s(int)':
a.cc:5:3: error: 'ans' was not declared in this scope; did you mean 'abs'?
    5 |   ans = 0;
      |   ^~~
      |   abs
Language: C++

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

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

  int sum = 0, tmp = N;
  while (tmp > 0) {
    sum += tmp % 10;
    tmp /= 10;
  }

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


Compiler output:
a.cc: In function 'int main()':
a.cc:8:22: error: 'N' was not declared in this scope
    8 |   int sum = 0, tmp = N;
      |                      ^
Language: C++

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

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

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

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

int count = 0;
int f(int a){
  while(a > 0){
    count += a % 10;
    a /= 10;
    return count;
  }
}

int main(){
  int n; cin >> n;
  if(f(n) % n == 0) cout << "Yes" << endl;
  else cout << "No" << endl;
}

Compiler output:
a.cc: In function 'int f(int)':
a.cc:7:5: error: reference to 'count' is ambiguous
    7 |     count += a % 10;
      |     ^~~~~
In file included from /usr/include/c++/14/algorithm:86,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:101:1: note: candidates are: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Tp> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, typename std::iterator_traits<_II>::difference_type> std::count(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, const _Tp&)'
  101 | count(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value);
      | ^~~~~
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:4025:5: note:                 'template<class _IIter, class _Tp> typename std::iterator_traits< <template-parameter-1-1> >::difference_type std::count(_IIter, _IIter, const _Tp&)'
 4025 |     count(_InputIterator __first, _InputIterator __last, const _Tp& __value)
      |     ^~~~~
a.cc:4:5: note:                 'int count'
    4 | int count = 0;
      |     ^~~~~
a.cc:9:12: error: reference to 'count' is ambiguous
    9 |     return count;
      |            ^~~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:101:1: note: candidates are: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Tp> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, typename std::iterator_traits<_II>::difference_type> std::count(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, const _Tp&)'
  101 | count(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value);
      | ^~~~~
/usr/include/c++/14/bits/stl_algo.h:4025:5: note:                 'template<class _IIter, class _Tp> typename std::iterator_traits< <template-parameter-1-1> >::difference_type std::count(_IIter, _IIter, const _Tp&)'
 4025 |     count(_InputIterator __first, _InputIterator __last, const _Tp& __value)
      |     ^~~~~
a.cc:4:5: note:                 'int count'
    4 | int count = 0;
      |     ^~~~~
Language: C++

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

int count = 0;
int f(int a){
  while(a > 0){
    count += a % 10;
    a /= 10;
    return a;
  }
}

int main(){
  int n; cin >> n;
  if(f(n) % n == 0) cout << "Yes" << endl;
  else cout << "No" << endl;
}

Compiler output:
a.cc: In function 'int f(int)':
a.cc:7:5: error: reference to 'count' is ambiguous
    7 |     count += a % 10;
      |     ^~~~~
In file included from /usr/include/c++/14/algorithm:86,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:101:1: note: candidates are: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Tp> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, typename std::iterator_traits<_II>::difference_type> std::count(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, const _Tp&)'
  101 | count(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value);
      | ^~~~~
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:4025:5: note:                 'template<class _IIter, class _Tp> typename std::iterator_traits< <template-parameter-1-1> >::difference_type std::count(_IIter, _IIter, const _Tp&)'
 4025 |     count(_InputIterator __first, _InputIterator __last, const _Tp& __value)
      |     ^~~~~
a.cc:4:5: note:                 'int count'
    4 | int count = 0;
      |     ^~~~~
a.cc:11:1: warning: control reaches end of non-void function [-Wreturn-type]
   11 | }
      | ^
Language: C++

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

int count = 0
int f(int a){
  while(a > 0){
    count += a % 10;
    a /= 10;
    return a;
  }
}

int main(){
  int n; cin >> n;
  if(f(n) % n == 0) cout << "Yes" << endl;
  else cout << "No" << endl;
}

Compiler output:
a.cc:5:1: error: expected ',' or ';' before 'int'
    5 | int f(int a){
      | ^~~
a.cc: In function 'int main()':
a.cc:15:6: error: 'f' was not declared in this scope
   15 |   if(f(n) % n == 0) cout << "Yes" << endl;
      |      ^
Language: C++

#include <iostream>
using namespace std;

int main(){
int N,ans,dig;
  cin >> N;
  double dig;
  
  if(N%10==0){
    int sec=1;
  cout << "Yes";
  }
  while(N>0){
    dig=N%10;
    ans=ans+dig;
    N=N/10;
  }
 
  if(N%ans==0){
    cout << "Yes"<<endl;
  }
  if(N%ans!=0){
    cout << "No"<<endl;
  }
  

return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:10: error: conflicting declaration 'double dig'
    7 |   double dig;
      |          ^~~
a.cc:5:11: note: previous declaration as 'int dig'
    5 | int N,ans,dig;
      |           ^~~
Language: C++

#include <iostream>
using namespace std;

int main(){
int N,ans,dig;
  cin >> N;
  double dig;
  
  if(N%10==0){
    int sec=1;
  cout << sec;
  return 0;
  }
  while(N>0){
    dig=N%10;
    ans=ans+dig;
    N=N/10;
  }
 
  if(N%ans==0){
    cout << "Yes"<<endl;
  }else if(N%ans!=0){
    cout << "No"<<endl;
  }else{
  }
  

return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:10: error: conflicting declaration 'double dig'
    7 |   double dig;
      |          ^~~
a.cc:5:11: note: previous declaration as 'int dig'
    5 | int N,ans,dig;
      |           ^~~
Language: C++

#include <iostream>
using namespace std;

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

return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:10: error: conflicting declaration 'double dig'
    7 |   double dig;
      |          ^~~
a.cc:5:11: note: previous declaration as 'int dig'
    5 | int N,ans,dig;
      |           ^~~
Language: C++

#include <iostream>
using namespace std;

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

return 0;
}

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

#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> plglg;
typedef pair<double, ll> pdlg;
typedef tuple<int, int, int> tiii;
typedef tuple<ll, ll, ll> tlglglg;
typedef tuple<double, double, double> tddd;

int main(void){
  int input;
  cin >> input;

  string str = to_string(input);
  int s = 0;
  for(int i = 0; i < str.size(); i++){
    int strint = (int)str[i];
    int temp = (strint - '0');
    s += temp;
  }
  if(n%s == 0){
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:6: error: 'n' was not declared in this scope
   26 |   if(n%s == 0){
      |      ^
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> plglg;
typedef pair<double, ll> pdlg;
typedef tuple<int, int, int> tiii;
typedef tuple<ll, ll, ll> tlglglg;
typedef tuple<double, double, double> tddd;

int main(void){
  string str;
  cin >> str;

  int n = (int)str;
  int s = 0;
  for(int i = 0; i < str.size(); i++){
    int strint = (int)str[i];
    int temp = (strint - '0');
    s += temp;
  }
  if(n%s == 0){
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:11: error: invalid cast from type 'std::string' {aka 'std::__cxx11::basic_string<char>'} to type 'int'
   19 |   int n = (int)str;
      |           ^~~~~~~~
Language: C++

#include<stdio.h>

using namespace std;

int main()
{
  int num = 0;
  int dig;
  int sum = 0;
  scanf("%d", &num);
  while(num){
    dig = num % 10;
    sum = sum + dig;
    num = num / 10;
    printf("%d\n", sum)
    return 0;
    
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:24: error: expected ';' before 'return'
   15 |     printf("%d\n", sum)
      |                        ^
      |                        ;
   16 |     return 0;
      |     ~~~~~~
Language: C++

#include<stdio.h>

using namespace std;

int main()
{
  int num = 0;
  int dig;
  int sum = 0;
  scanf("%d", &num);
  while(num){
    dig = num % 10;
    sum = sum + dig;
    num = num / 10;
    printf("%d\n", sum)
    
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:24: error: expected ';' before '}' token
   15 |     printf("%d\n", sum)
      |                        ^
      |                        ;
   16 | 
   17 |   }
      |   ~
Language: C++

#include<stdio.h>

using namespace std;

int main()
{
  int num = 0;
  int dig;
  int sum = 0;
  scanf("%d", &num);
  while(num){
    dig = num % 10;
    sum = sum + dig;
    num = num / 10;
    printf("%d\m", sum)
    
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:12: warning: unknown escape sequence: '\m'
   15 |     printf("%d\m", sum)
      |            ^~~~~~
a.cc:15:24: error: expected ';' before '}' token
   15 |     printf("%d\m", sum)
      |                        ^
      |                        ;
   16 | 
   17 |   }
      |   ~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:13:7: error: lvalue required as left operand of assignment
   13 |   if(n%s=0) cout << "Yes" <<endl;
      |      ~^~
Language: C++

#include <iostream>
using namespace std;
 //Compiler version g++ 6.3.0

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

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

#include <iostream>
using namespace std;
 
int main()
{
	long long int p, q;
  cin>>p;
  q = p;
  int a = 0;
  while(p>0)
  {
   a = a + p%10;
    p = p/10;
  }
  if(q%a==0)
    cout<<"No";
  else
    cout<<"Yes";
}
#include <iostream>
using namespace std;

int main()
{
	long long int p, q;
  cin>>p;
  q = p;
  int a = 0;
  while(p>0)
  {
   a = a + p%10;
    p = p/10;
  }
  if(q%a!=0)
    cout<<"No";
  else
    cout<<"Yes";
}


Compiler output:
a.cc:23:5: error: redefinition of 'int main()'
   23 | int main()
      |     ^~~~
a.cc:4:5: note: 'int main()' previously defined here
    4 | int main()
      |     ^~~~
Language: C

#include<stdio.h>
int main()
{
    int n,k,x,sum;
   scanf("%d",&n);sum=0;
for(k=0;n!=0;k++)
{
x=n%10;
n/=10;
sum+=x;
}
if(n%sum==0)
printf("Yes\n");
else 
printf("No\n");
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:4:1: error: stray '\302' in program
    4 | <U+00A0><U+00A0><U+00A0> int n,k,x,sum;
      | ^~~~~~~~
main.c:4:2: error: stray '\302' in program
    4 | <U+00A0><U+00A0><U+00A0> int n,k,x,sum;
      |         ^~~~~~~~
main.c:4:3: error: stray '\302' in program
    4 | <U+00A0><U+00A0><U+00A0> int n,k,x,sum;
      |                 ^~~~~~~~
main.c:5:1: error: stray '\302' in program
    5 | <U+00A0><U+00A0> scanf("%d",&n);sum=0;
      | ^~~~~~~~
main.c:5:2: error: stray '\302' in program
    5 | <U+00A0><U+00A0> scanf("%d",&n);sum=0;
      |         ^~~~~~~~
Language: C++

#include<iostream>
using namespace std;

int main(void) {
	string N;
	cin >> N;
	int S = 0;
	for (int i = 0; i < N.length(); i++) {
		S += N[i];
	}

	if (N % S == 0) {
		cout << "Yes" << "\n";
	} else {
		cout << "No" << "\n";
	}

}




Compiler output:
a.cc: In function 'int main()':
a.cc:12:15: error: no match for 'operator%' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
   12 |         if (N % S == 0) {
      |             ~ ^ ~
      |             |   |
      |             |   int
      |             std::string {aka std::__cxx11::basic_string<char>}
Language: C

#include<bits/stdc++.h>
using namespace std;
long long int i,j,k=0,ta,n;
char s[1000],t[1000];
int main()
{
    scanf("%lld",&n);
    i=n;
    while(i!=0){
        k=k+(n%10);
        i=i/10;
    }
    if(n%k==0)
        printf("Yes\n");
    else
        printf("No\n");
    return 0;
}


Compiler output:
main.c:1:9: fatal error: bits/stdc++.h: No such file or directory
    1 | #include<bits/stdc++.h>
      |         ^~~~~~~~~~~~~~~
compilation terminated.