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

#include <iostream>
#include <vector> //可変長配列
#include <queue> //キュー
#include <unordered_map> //ハッシュ連想配列
#include <numeric>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#define ll long long int
#define INFTY (1<<21)

using namespace std;

int main(void){
    cin.sync_with_stdio(false);
    int n,a,b;
    cin>>n>>a>>b;
    a *= n;
    cout<<(a>b?b:a)<<endl;
    return 0;
}


Compiler output:
a.cc:16:1: error: extended character   is not valid in an identifier
   16 |     cin.sync_with_stdio(false);
      | ^
a.cc:16:1: error: extended character   is not valid in an identifier
a.cc:16:1: error: extended character   is not valid in an identifier
a.cc:16:1: error: extended character   is not valid in an identifier
a.cc:17:1: error: extended character   is not valid in an identifier
   17 |     int n,a,b;
      | ^
a.cc:17:1: error: extended character   is not valid in an identifier
a.cc:17:1: error: extended character   is not valid in an identifier
a.cc:17:1: error: extended character   is not valid in an identifier
a.cc:18:1: error: extended character   is not valid in an identifier
   18 |     cin>>n>>a>>b;
      | ^
a.cc:18:1: error: extended character   is not valid in an identifier
a.cc:18:1: error: extended character   is not valid in an identifier
a.cc:18:1: error: extended character   is not valid in an identifier
a.cc:21:1: error: extended character   is not valid in an identifier
   21 |     return 0;
      | ^
a.cc:21:1: error: extended character   is not valid in an identifier
a.cc:21:1: error: extended character   is not valid in an identifier
a.cc:21:1: error: extended character   is not valid in an identifier
a.cc: In function 'int main()':
a.cc:16:1: error: '\U000000a0\U000000a0\U000000a0\U000000a0cin' was not declared in this scope
   16 |     cin.sync_with_stdio(false);
      | ^~~~~~~
a.cc:17:1: error: '\U000000a0\U000000a0\U000000a0\U000000a0int' was not declared in this scope
   17 |     int n,a,b;
      | ^~~~~~~
a.cc:18:10: error: 'n' was not declared in this scope; did you mean 'yn'?
   18 |     cin>>n>>a>>b;
      |          ^
      |          yn
a.cc:18:13: error: 'a' was not declared in this scope
   18 |     cin>>n>>a>>b;
      |             ^
a.cc:18:16: error: 'b' was not declared in this scope
   18 |     cin>>n>>a>>b;
      |                ^
a.cc:21:1: error: '\U000000a0\U000000a0\U000000a0\U000000a0return' was not declared in this scope
   21 |     return 0;
      | ^~~~~~~~~~
Language: C

#include<stdio.h>
#include<windows.h>
int main(){
	int n,a,b;
	scanf("%d%d%d",&n,&a,&b);
	printf("%d\n",min(n*a,b));
}

Compiler output:
main.c:2:9: fatal error: windows.h: No such file or directory
    2 | #include<windows.h>
      |         ^~~~~~~~~~~
compilation terminated.
Language: C++

#include<stdio.h>
#include<windows.h>
int main(){
	int n,a,b;
	scanf("%d%d%d",&n,&a,&b);
	printf("%d\n",min(n*a,b));
}

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

#include <bits/stdc++.h>

int main(void) {
	int N, A, B;
	cout << max(A * N, B) << '\n';
	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    5 |         cout << max(A * N, B) << '\n';
      |         ^~~~
      |         std::cout
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:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:5:17: error: 'max' was not declared in this scope; did you mean 'std::max'?
    5 |         cout << max(A * N, B) << '\n';
      |                 ^~~
      |                 std::max
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: 'std::max' declared here
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
Language: C++

#include<stdio.h>
#include <iostream>
#include<string>
#include<algorithm>
#include<sstream>
#include<math.h>
using namespaec std;
int main() {
	int n, a, b;
	cin >> n >> a >> b;
	cout << min(n*a, b) << endl;
	return 0;

}

Compiler output:
a.cc:7:7: error: expected nested-name-specifier before 'namespaec'
    7 | using namespaec std;
      |       ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:10:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   10 |         cin >> n >> a >> b;
      |         ^~~
      |         std::cin
In file included from a.cc:2:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:11:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   11 |         cout << min(n*a, b) << 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:11:17: error: 'min' was not declared in this scope; did you mean 'std::min'?
   11 |         cout << min(n*a, b) << endl;
      |                 ^~~
      |                 std::min
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:4:
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: 'std::min' declared here
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
a.cc:11:32: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   11 |         cout << min(n*a, b) << endl;
      |                                ^~~~
      |                                std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

include <iostream>
using namespace std;

int main()
{
    int N, A, B;
    cin >> N >> A >> B;

    cout << (N*A < B ? N*A : B) << endl;

    return 0;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <iostream>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:7:5: error: 'cin' was not declared in this scope
    7 |     cin >> N >> A >> B;
      |     ^~~
a.cc:9:5: error: 'cout' was not declared in this scope
    9 |     cout << (N*A < B ? N*A : B) << endl;
      |     ^~~~
a.cc:9:36: error: 'endl' was not declared in this scope
    9 |     cout << (N*A < B ? N*A : B) << endl;
      |                                    ^~~~
Language: C++

#include <iostream>
#include <String>
#include <algorithm>
using namespace std;
int main(void){

  int n, a, b;
  cin >> n >> a >> b;
  cout << min(n * a, b) << endl;
  return 0;
}


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

#include<stdio.h>
using namespace std;
int main() {
	int n,a,b;
	scanf("%d%d%d",&n,&a,&b);
	printf("%d\n",min(a*n,b));
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:23: error: 'min' was not declared in this scope; did you mean 'main'?
    6 |         printf("%d\n",min(a*n,b));
      |                       ^~~
      |                       main
Language: C++

#include <vector>
#include <iostream>
#include <map>
#include <string>
#include <utility>
#include <algorithm>

const int INF = 1001001000;
const int MOD = (int)1e9 + 7;

using ll = long long;

using namespace std;

int main(){

  int n,a,b;
  int x1,x2;

  cin >> n >> a >> b;

  x1 = a*n;
  x2 = b;

  if( x1 < x2){
    cout << x1 << endl;
  }else{
    cout << x2 << endl;
  }

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

#include<stdio.h>
#include <iostream>
#include<string>
#include<algorithm>
#include<sstream>
#include<math.h>
int main() {
	int n, a, b;
	cin >> n >> a >> b;
	cout << min(n*a, b) << endl;
	return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    9 |         cin >> n >> a >> b;
      |         ^~~
      |         std::cin
In file included from a.cc:2:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:10:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   10 |         cout << min(n*a, b) << 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:10:17: error: 'min' was not declared in this scope; did you mean 'std::min'?
   10 |         cout << min(n*a, b) << endl;
      |                 ^~~
      |                 std::min
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:4:
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: 'std::min' declared here
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
a.cc:10:32: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   10 |         cout << min(n*a, b) << endl;
      |                                ^~~~
      |                                std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C

$0=$1*$2<$3?$1*$2:$3

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | $0=$1*$2<$3?$1*$2:$3
      | ^~
main.c:1:1: error: type defaults to 'int' in declaration of '$0' [-Wimplicit-int]
main.c:1:4: error: '$1' undeclared here (not in a function); did you mean '$0'?
    1 | $0=$1*$2<$3?$1*$2:$3
      |    ^~
      |    $0
main.c:1:7: error: '$2' undeclared here (not in a function); did you mean '$0'?
    1 | $0=$1*$2<$3?$1*$2:$3
      |       ^~
      |       $0
main.c:1:10: error: '$3' undeclared here (not in a function); did you mean '$0'?
    1 | $0=$1*$2<$3?$1*$2:$3
      |          ^~
      |          $0
main.c:1:1: error: expected ',' or ';' at end of input
    1 | $0=$1*$2<$3?$1*$2:$3
      | ^~
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <set>
#include <queue>

#define int_inf 1000000000 //1e9
#define ll_inf  100000000000000000 //1e17




int main(){
	int n, a, b;
	cin >> n >> a >> b;
	
	cout << min(n*a,b) << endl;
	
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   16 |         cin >> n >> a >> b;
      |         ^~~
      |         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:18:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   18 |         cout << min(n*a,b) << 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:18:17: error: 'min' was not declared in this scope; did you mean 'std::min'?
   18 |         cout << min(n*a,b) << endl;
      |                 ^~~
      |                 std::min
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:4:
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: 'std::min' declared here
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
a.cc:18:31: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   18 |         cout << min(n*a,b) << endl;
      |                               ^~~~
      |                               std::endl
In file included from /usr/include/c++/14/iostream:41:
/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;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;

#define fi first
#define se second
#define repl(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
#define rep(i,n) repl(i,0,n)
#define each(itr,v) for(auto itr:v)
#define pb push_back
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<x<<endl
#define mmax(x,y) (x>y?x:y)
#define mmin(x,y) (x<y?x:y)
#define maxch(x,y) x=mmax(x,y)
#define minch(x,y) x=mmin(x,y)
#define uni(x) x.erase(unique(all(x)),x.end())
#define exist(x,y) (find(all(x),y)!=x.end())
#define bcnt __builtin_popcount

#define INF INT_MAX/3

int n,a,b;

int main(){
  cin>>n>>a>>b;
	cout<<min(a*t,b)<<endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:21: error: 't' was not declared in this scope; did you mean 'tm'?
   30 |         cout<<min(a*t,b)<<endl;
      |                     ^
      |                     tm
Language: C++

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

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


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

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

int main(){
  int N;
  
  int sum =0;
  
  for(int i=0;i<N.size();i++){
    cin>> N[i];
    sum++ ;
  }
  if(N%sum==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:12: error: invalid types 'int[int]' for array subscript
   10 |     cin>> N[i];
      |            ^
Language: C++

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

int main(){
    string S;
    cin >> S;
    vector<int> Sint(S.size());
    for (int i = 0; i < S.size(); i++) {
        Sint.at(i) = S.at(i) - '0';
    }
    int keta = 0;
    for (int i = 0; i < S.size(); i++) keta += Sint.at(i);
    vector<int> Smod(S.size());
    int m = 1;
    for (int i = S.size() - 1; i >= 0; i--) {
        Smod.at(i) = m;
        m = (m * 10) % keta;
    }
    ll sum = 0;
    for (int i = 0; i < S.size(); i++) {
        sum += (Sint.at(i) * Smod.at(i)) % keta;
        sum %= keta;
    }
    if (sum % keta == 0) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:5: error: 'll' was not declared in this scope
   19 |     ll sum = 0;
      |     ^~
a.cc:21:9: error: 'sum' was not declared in this scope
   21 |         sum += (Sint.at(i) * Smod.at(i)) % keta;
      |         ^~~
a.cc:24:9: error: 'sum' was not declared in this scope
   24 |     if (sum % keta == 0) cout << "Yes" << endl;
      |         ^~~
Language: C++

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

int main(){
  int n; cin >> n;
  string s = to_string(n);
  int h = 0;
  int m = s.size();
  for(int i = 0; i < m; i++){
    int t = s[i] - '0';
    h += t;
  }
  string ans;
  if(n % h == 0){ans = "Yes";}
  else ans = "No";
  cout << ans << endl;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:5:10: error: 'cin' was not declared in this scope
    5 |   int n; cin >> n;
      |          ^~~
a.cc:6:3: error: 'string' was not declared in this scope
    6 |   string s = to_string(n);
      |   ^~~~~~
a.cc:8:11: error: 's' was not declared in this scope
    8 |   int m = s.size();
      |           ^
a.cc:13:9: error: expected ';' before 'ans'
   13 |   string ans;
      |         ^~~~
      |         ;
a.cc:14:18: error: 'ans' was not declared in this scope
   14 |   if(n % h == 0){ans = "Yes";}
      |                  ^~~
a.cc:15:8: error: 'ans' was not declared in this scope
   15 |   else ans = "No";
      |        ^~~
a.cc:16:3: error: 'cout' was not declared in this scope
   16 |   cout << ans << endl;
      |   ^~~~
a.cc:16:11: error: 'ans' was not declared in this scope
   16 |   cout << ans << endl;
      |           ^~~
a.cc:16:18: error: 'endl' was not declared in this scope
   16 |   cout << ans << endl;
      |                  ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int X;
  cin X;
  int sum=0;
  int a;
  int b=100000000;
  int i=0;
  while(i<8){
    a=0;
    a+=(X%(b*10))/b;
    sum+=a;
    i++;
  }
    if(X%sum==0){
      cout<<"Yes<<endl;
    }else{
      cout<<"No"<<endl;
    }
    

}

Compiler output:
a.cc:18:13: warning: missing terminating " character
   18 |       cout<<"Yes<<endl;
      |             ^
a.cc:18:13: error: missing terminating " character
   18 |       cout<<"Yes<<endl;
      |             ^~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:6:6: error: expected ';' before 'X'
    6 |   cin X;
      |      ^~
      |      ;
a.cc:19:5: error: expected primary-expression before '}' token
   19 |     }else{
      |     ^
Language: C++

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

int main() {

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


Compiler output:
a.cc:14:1: error: expected declaration before '}' token
   14 | }
      | ^
Language: C++

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

int main() {

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



Compiler output:
a.cc:1:2: error: stray '#' in program
    1 | }#include <bits/stdc++.h>
      |  ^
a.cc:1:1: error: expected declaration before '}' token
    1 | }#include <bits/stdc++.h>
      | ^
a.cc:1:3: error: 'include' does not name a type
    1 | }#include <bits/stdc++.h>
      |   ^~~~~~~
a.cc: In function 'int main()':
a.cc:7:9: error: 'cin' was not declared in this scope
    7 |         cin >> N;
      |         ^~~
a.cc:10:17: error: 'cout' was not declared in this scope
   10 |                 cout << "Yes";
      |                 ^~~~
a.cc:12:17: error: 'cout' was not declared in this scope
   12 |                 cout << "No";
      |                 ^~~~
a.cc: At global scope:
a.cc:14:1: error: expected declaration before '}' token
   14 | }
      | ^
Language: C++

#include <iostream>
using namespace std;

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

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

#include <bits/stdc++.h>

using namespace std;

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


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

#include <bits/stdc++.h>
using namespace std;
int main(){
  int N,M;
  cin >> N;
  M=N/10000000+N/1000000+N/1000000+N/10000+N/1000+N/100+N/10
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:61: error: expected ';' before '}' token
    6 |   M=N/10000000+N/1000000+N/1000000+N/10000+N/1000+N/100+N/10
      |                                                             ^
      |                                                             ;
    7 | 
    8 | }
      | ~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
long int n,sum,i;
  sum=0;
stirng s;  
cin >> s;
  for(i=0;i<s.size();++i)
  {
  sum=sum+s.at(i);
  }
  n=s-'0';
  if(n%sum==0) cout << "Yes";
  else cout << "No";
return 0;}

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

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

int main() {
  int x;
  cin>>x;
  function<int(int)> f=[&](int x) {
    int res =0;
    while (x) {
      res += (x%10);
      x/=10;
    return res;
  };
    cout<<(x%f(x)==0 ? "Yes\n" : "No\n");
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:2: error: expected ',' or ';' at end of input
   15 | }
      |  ^
a.cc:15:2: error: expected '}' at end of input
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
a.cc: In lambda function:
a.cc:14:40: warning: control reaches end of non-void function [-Wreturn-type]
   14 |     cout<<(x%f(x)==0 ? "Yes\n" : "No\n");
      |                                        ^
Language: C++

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

int main() {
  int x;
  cin>>x;
  auto f=[&](int x) {
    int res =0;
    while (x) {
      res += (x%10);
      x/=10;
    return res;
  };
    cout<<(x%f(x)==0 ? "Yes\n" : "No\n");
}

Compiler output:
a.cc: In lambda function:
a.cc:14:14: error: use of 'f' before deduction of 'auto'
   14 |     cout<<(x%f(x)==0 ? "Yes\n" : "No\n");
      |              ^
a.cc: In function 'int main()':
a.cc:15:2: error: expected ',' or ';' at end of input
   15 | }
      |  ^
a.cc:15:2: error: expected '}' at end of input
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

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

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

    string s = to_string(n);
    int sum = 0;
    for (char x : s)
        sum += x - '0';
    if (x%sum == 0)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: 'x' was not declared in this scope
   12 |     if (x%sum == 0)
      |         ^
Language: Java

import java.util.*;
public class Main {
 
   static boolean isHarshad(int n) {
      
      Scanner scanner = new Scanner(System.in)
      int c = input.nextInt;
      
      int sum = 0;
      int d = 0;
      
      while (c > 0) {
         d = c % 10;
         sum = sum + d;
         c = c / 10;
      }
      return (n % sum == 0);
   }
 
   public static void main(String[] args) {
 
      int count = 0;
      int number = 1;
      while (count != 50) {
         if (isHarshad(number)) {
            System.out.println(number);
            count++;
         }
         number++;
      }
   }
}

Compiler output:
Main.java:6: error: ';' expected
      Scanner scanner = new Scanner(System.in)
                                              ^
1 error
Language: C++

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

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

}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:14: error: expected ';' before 'sum'
   12 |     C = N/B%A
      |              ^
      |              ;
   13 |     sum += C;
      |     ~~~
Language: C++

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

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


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

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

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

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

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

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

#include <bits/stdc++.h>
using namespace std;
int main (){
  int N,K,sum,s;
  cin>>N;
  K=1;
  for (int i=0;i<8;i++){
    for(int j=0;j<i;j++){
      K*=10;
    }
    s=(N-N%K)%k*10/K;
    sum+=s;
  }
  int m;
  m=N%sum;
  if (m==0){
    cout<<"Yes"<<endl;
  }
  else{
    cout<<"No"<<endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:15: error: 'k' was not declared in this scope
   11 |     s=(N-N%K)%k*10/K;
      |               ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main (){
  int N,K,sum,s;
  cin>>N;
  K=1;
  for (i=0;i<8;i++){
    for(j=0;j<i;j++){
      K*=10;
    }
    s=(N-N%K)%k*10/K;
    sum+=s;
  }
  int m;
  m=N%sum;
  if (m==0){
    cout<<"Yes"<<endl;
  }
  else{
    cout<<"No"<<endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:8: error: 'i' was not declared in this scope
    7 |   for (i=0;i<8;i++){
      |        ^
a.cc:8:9: error: 'j' was not declared in this scope
    8 |     for(j=0;j<i;j++){
      |         ^
a.cc:11:15: error: 'k' was not declared in this scope
   11 |     s=(N-N%K)%k*10/K;
      |               ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:15:6: error: invalid cast from type 'std::string' {aka 'std::__cxx11::basic_string<char>'} to type 'int'
   15 |   if((int)str % num == 0){
      |      ^~~~~~~~
Language: C++

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

int main(){
  int N;
  cin >> N;
  
  string num = to_string(N);
  num = num + "000000000";
  
  int  sum=0;
  
  for(int i=0; i<9; i++){
    sum += stoi(num.at(i));
  }
  
  if(N%sum == 0){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
  
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:16: error: no matching function for call to 'stoi(__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type&)'
   14 |     sum += stoi(num.at(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;
  
  string num = to_string(N);
  num = num + "000000000";
  
  int  sum=0;
  
  for(int i=0; i<9; i++){
    sum += stoi(num_at(i));
  }
  
  if(N%sum == 0){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
  
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:17: error: 'num_at' was not declared in this scope
   14 |     sum += stoi(num_at(i));
      |                 ^~~~~~
Language: C++

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

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

#include<bits/stdc++.h>
using namespace std;
int main(){
  int q,z,y=0;
  cin>>q;//qはN桁の数字
  z=q;
  while(z>0){
    y= y + Z % 10;//qを10で割った余り(1の位)をyに足す　最終的にf(x)になる
    z = z / 10;//f(x)を作るために桁を一つ下げてる
  }
  if(q%y==0) cout<<"Yes"<<endl;//qをyで割ると0
  else cout<<"No"<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:12: error: 'Z' was not declared in this scope
    8 |     y= y + Z % 10;//qを10で割った余り(1の位)をyに足す　最終的にf(x)になる
      |            ^
Language: C++

#include<iostream>
using namespace std;
int digit(int n){
   int H=0;
  	while(n!=0){
		H+=n%10;
    	n=n/10;
 	 }
    return H;
  }
  int main(){
    int n;
    cin >> n;
  if(n%digit[n]==0){
    cout << "Yes" << endl;
  }
  else{
    cout << "No" << endl;
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:15: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   14 |   if(n%digit[n]==0){
      |               ^
a.cc:14:7: error: invalid operands of types 'int' and 'int(int)' to binary 'operator%'
   14 |   if(n%digit[n]==0){
      |      ~^~~~~~~~~
      |      |        |
      |      int      int(int)
Language: C++

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

Compiler output:
a.cc:5:3: error: expected unqualified-id before 'while'
    5 |   while(n!=0){
      |   ^~~~~
a.cc:9:3: error: expected unqualified-id before 'return'
    9 |   return ans;
      |   ^~~~~~
a.cc:10:1: error: expected declaration before '}' token
   10 | }
      | ^
Language: C++

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

Compiler output:
a.cc:12:3: error: expected primary-expression before 'int'
   12 |   int n;
      |   ^~~
a.cc:11:12: error: expected ']' before 'int'
   11 | int main()[
      |            ^
      |            ]
   12 |   int n;
      |   ~~~       
a.cc:13:3: error: 'cin' does not name a type
   13 |   cin >> n;
      |   ^~~
a.cc:14:3: error: expected unqualified-id before 'if'
   14 |   if(n % maimai(n)==0){
      |   ^~
a.cc:17:5: error: expected unqualified-id before 'else'
   17 |     else[
      |     ^~~~
a.cc:19:7: error: expected declaration before '}' token
   19 |       }
      |       ^
a.cc:20:7: error: expected declaration before '}' token
   20 |       }
      |       ^
Language: C++

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

Compiler output:
a.cc:5:3: error: expected unqualified-id before 'while'
    5 |   while(n!=0){
      |   ^~~~~
a.cc:9:3: error: expected unqualified-id before 'return'
    9 |   return ans;
      |   ^~~~~~
a.cc:10:1: error: expected declaration before '}' token
   10 | }
      | ^
a.cc:21:3: error: expected unqualified-id before 'return'
   21 |   return 0;
      |   ^~~~~~
a.cc:22:1: error: expected declaration before '}' token
   22 | }
      | ^
Language: C++

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

Compiler output:
a.cc: In function 'int digit(int)':
a.cc:5:10: error: expected ')' before '!' token
    5 |   while(n! = 0){
      |        ~ ^
      |          )
a.cc:5:12: error: expected primary-expression before '=' token
    5 |   while(n! = 0){
      |            ^
Language: C++

#include<bits/stdc++.h>
#define rep(i,n) for(i=0;i<(n);i++){
int tintin(int n){
using namespace std;
using ll=long long;
using P=pair<int,int>;
int main(){
  int ans=0;
  while(n!=0){
    ans+=n%10;
    n=n/10;
  }
  return ans;
}
  int main(){
    int n;
    cin >> n;
    if(n%tintin(n)==0){
      cout << "Yes" << endl;
    }
    else{
cout << "No" << endl;
    }
  }
  return 0;
}
    
 

Compiler output:
a.cc: In function 'int tintin(int)':
a.cc:7:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
    7 | int main(){
      |         ^~
a.cc:7:9: note: remove parentheses to default-initialize a variable
    7 | int main(){
      |         ^~
      |         --
a.cc:7:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:7:11: error: a function-definition is not allowed here before '{' token
    7 | int main(){
      |           ^
a.cc:15:11: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   15 |   int main(){
      |           ^~
a.cc:15:11: note: remove parentheses to default-initialize a variable
   15 |   int main(){
      |           ^~
      |           --
a.cc:15:11: note: or replace parentheses with braces to value-initialize a variable
a.cc:15:13: error: a function-definition is not allowed here before '{' token
   15 |   int main(){
      |             ^
Language: C++

#include<bits/stdc++.h>
#define rep(i,n) for(i=0;i<(n);i++){
int yamagutitatuya(int n){
using namespace std;
using ll=long long;
using P=pair<int,int>;
int main(){
  int ans=0;
  while(n!=0){
    ans+=n%10;
    n=n/10;
  }
  return ans;
}
  int main(){
    int n;
    cin >> n;
    if(n%yamagutitatuya(n)==0){
      cout << "Yes" << endl;
    }
    else{
cout << "No" << endl;
    }
  }
  return 0;
}
    
 

Compiler output:
a.cc: In function 'int yamagutitatuya(int)':
a.cc:7:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
    7 | int main(){
      |         ^~
a.cc:7:9: note: remove parentheses to default-initialize a variable
    7 | int main(){
      |         ^~
      |         --
a.cc:7:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:7:11: error: a function-definition is not allowed here before '{' token
    7 | int main(){
      |           ^
a.cc:15:11: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   15 |   int main(){
      |           ^~
a.cc:15:11: note: remove parentheses to default-initialize a variable
   15 |   int main(){
      |           ^~
      |           --
a.cc:15:11: note: or replace parentheses with braces to value-initialize a variable
a.cc:15:13: error: a function-definition is not allowed here before '{' token
   15 |   int main(){
      |             ^
Language: C++

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

Compiler output:
a.cc:12:3: error: expected primary-expression before 'int'
   12 |   int n;
      |   ^~~
a.cc:11:12: error: expected ']' before 'int'
   11 | int main()[
      |            ^
      |            ]
   12 |   int n;
      |   ~~~       
a.cc:13:3: error: 'cin' does not name a type
   13 |   cin >> n;
      |   ^~~
a.cc:14:3: error: expected unqualified-id before 'if'
   14 |   if(n % maimai(n)==0){
      |   ^~
a.cc:19:7: error: expected declaration before '}' token
   19 |       }
      |       ^
Language: C++

#include<iostream>
using namespace std;
int main(){
  string n;
  int i,a,b=0;
  a=n.size();
  for(i=0;i<a;i++){
    b=b+n.at(i);
  }
  if(n%b==0){
    cout << "Yes" << endl;
  }
  else{
    cout << "No" << endl;
  }
}

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

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

int main(){
  int N;
  cin >> N;
  int fn = 0;
  for(char s : to_string(N)){
    fn += stoi(s);
  }
  cout << (N % fn == 0 ? "Yes" : "No") << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:15: error: no matching function for call to 'stoi(char&)'
    9 |     fn += stoi(s);
      |           ~~~~^~~
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 '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 '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 fn = 0;
  for(char s : to_string(N).c_str()){
    fn += stoi(s);
  }
  cout << (N % fn == 0 ? "Yes" : "No") << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:35: error: 'begin' was not declared in this scope
    8 |   for(char s : to_string(N).c_str()){
      |                                   ^
a.cc:8:35: note: suggested alternatives:
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166,
                 from a.cc:1:
/usr/include/c++/14/valarray:1238:5: note:   'std::begin'
 1238 |     begin(const valarray<_Tp>& __va) noexcept
      |     ^~~~~
In file included from /usr/include/c++/14/filesystem:53,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:200:
/usr/include/c++/14/bits/fs_dir.h:608:3: note:   'std::filesystem::__cxx11::begin'
  608 |   begin(recursive_directory_iterator __iter) noexcept
      |   ^~~~~
a.cc:8:35: error: 'end' was not declared in this scope
    8 |   for(char s : to_string(N).c_str()){
      |                                   ^
a.cc:8:35: note: suggested alternatives:
/usr/include/c++/14/valarray:1265:5: note:   'std::end'
 1265 |     end(const valarray<_Tp>& __va) noexcept
      |     ^~~
/usr/include/c++/14/bits/fs_dir.h:613:3: note:   'std::filesystem::__cxx11::end'
  613 |   end(recursive_directory_iterator) noexcept
      |   ^~~
a.cc:9:15: error: no matching function for call to 'stoi(char&)'
    9 |     fn += stoi(s);
      |           ~~~~^~~
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:
/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 '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 '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 fn = 0;
  for(string s : to_string(N).c_str()){
    fn += stoi(s);
  }
  cout << (N % fn == 0 ? "Yes" : "No") << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:37: error: 'begin' was not declared in this scope
    8 |   for(string s : to_string(N).c_str()){
      |                                     ^
a.cc:8:37: note: suggested alternatives:
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166,
                 from a.cc:1:
/usr/include/c++/14/valarray:1238:5: note:   'std::begin'
 1238 |     begin(const valarray<_Tp>& __va) noexcept
      |     ^~~~~
In file included from /usr/include/c++/14/filesystem:53,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:200:
/usr/include/c++/14/bits/fs_dir.h:608:3: note:   'std::filesystem::__cxx11::begin'
  608 |   begin(recursive_directory_iterator __iter) noexcept
      |   ^~~~~
a.cc:8:37: error: 'end' was not declared in this scope
    8 |   for(string s : to_string(N).c_str()){
      |                                     ^
a.cc:8:37: note: suggested alternatives:
/usr/include/c++/14/valarray:1265:5: note:   'std::end'
 1265 |     end(const valarray<_Tp>& __va) noexcept
      |     ^~~
/usr/include/c++/14/bits/fs_dir.h:613:3: note:   'std::filesystem::__cxx11::end'
  613 |   end(recursive_directory_iterator) noexcept
      |   ^~~
Language: C++

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

int main(){
  int N;
  cin >> N;
  int fn = 0;
  for(string s : to_string(N)){
    fn += stoi(s);
  }
  cout << (N % fn == 0 ? "Yes" << "No") << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:29: error: conversion from 'char' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
    8 |   for(string s : to_string(N)){
      |                             ^
a.cc:11:32: error: invalid operands of types 'const char [4]' and 'const char [3]' to binary 'operator<<'
   11 |   cout << (N % fn == 0 ? "Yes" << "No") << endl;
      |                          ~~~~~ ^~ ~~~~
      |                          |        |
      |                          |        const char [3]
      |                          const char [4]
a.cc:11:39: error: expected ':' before ')' token
   11 |   cout << (N % fn == 0 ? "Yes" << "No") << endl;
      |                                       ^
      |                                       :
a.cc:11:39: error: expected primary-expression before ')' token
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:11: error: expected initializer before '+=' token
   10 |     int x += stoi(n);
      |           ^~
a.cc:12:11: error: 'x' was not declared in this scope
   12 |   if (N % x == 0){
      |           ^
Language: C++

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

int sum(int n){
  int res　= 0;
  while(n / 10 > 0){
    res += n % 10;
    n /= 10;
  }
  return res;
}

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


Compiler output:
a.cc:5:7: error: extended character 　 is not valid in an identifier
    5 |   int res　= 0;
      |       ^
a.cc: In function 'int sum(int)':
a.cc:7:5: error: 'res' was not declared in this scope
    7 |     res += n % 10;
      |     ^~~
a.cc:10:10: error: 'res' was not declared in this scope
   10 |   return res;
      |          ^~~
Language: C++

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


Compiler output:
a.cc:8:1: error: extended character 　 is not valid in an identifier
    8 | 　while (t>0) {
      | ^
a.cc:12:1: error: extended character 　 is not valid in an identifier
   12 | 　if (N%c==0) {
      | ^
a.cc: In function 'int main()':
a.cc:8:1: error: '\U00003000while' was not declared in this scope
    8 | 　while (t>0) {
      | ^~~~~~~
a.cc:12:1: error: '\U00003000if' was not declared in this scope
   12 | 　if (N%c==0) {
      | ^~~~
a.cc:15:3: error: 'else' without a previous 'if'
   15 |   else {
      |   ^~~~
Language: C++

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


Compiler output:
a.cc:7:1: error: extended character 　 is not valid in an identifier
    7 | 　while (t >0) {
      | ^
a.cc:11:1: error: extended character 　 is not valid in an identifier
   11 | 　if (N % c ==0) {
      | ^
a.cc: In function 'int main()':
a.cc:7:1: error: '\U00003000while' was not declared in this scope
    7 | 　while (t >0) {
      | ^~~~~~~
a.cc:11:1: error: '\U00003000if' was not declared in this scope
   11 | 　if (N % c ==0) {
      | ^~~~
a.cc:14:3: error: 'else' without a previous 'if'
   14 |   else {
      |   ^~~~
Language: C++

#include <bits/stdc++.h> 
using namespace std; 
int main() { 
  int N;
  cin >> 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:7:1: error: extended character 　 is not valid in an identifier
    7 | 　while (t >0) {
      | ^
a.cc:10:1: error: extended character 　 is not valid in an identifier
   10 | 　if (N % c ==0) puts ("Yes");
      | ^
a.cc: In function 'int main()':
a.cc:7:1: error: '\U00003000while' was not declared in this scope
    7 | 　while (t >0) {
      | ^~~~~~~
a.cc:10:1: error: '\U00003000if' was not declared in this scope
   10 | 　if (N % c ==0) puts ("Yes");
      | ^~~~
a.cc:11:3: error: 'else' without a previous 'if'
   11 |   else puts ("No")
      |   ^~~~
a.cc:11:19: error: expected ';' before '}' token
   11 |   else puts ("No")
      |                   ^
      |                   ;
   12 | }
      | ~