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

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <vector>
#include <queue>
#include <iostream>
#include <set>
#include <map>
#include <string>
#include <algorithm>
#include <stack>
#include <sstream>
#include <list>
 
using namespace std;
 
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define PB push_back
#define PF push_front
 
 
typedef long long int ll;
typedef pair<int, int> Pii;
typedef pair<int, double> Pid;
typedef pair<double, int> Pdi;
typedef pair<double, double> Pdd;
typedef pair<ll, ll> P;
typedef pair<P, ll> PP;
 
 
const ll mod = 1e9+7;
const ll INF = 2e9;
const double epsilon = 1e-7;
const double PI = 3.1415926535;
 
ll gcd(ll a,ll b) {return b?gcd(b,a%b):a;}
 
 
 
int main(){
  string x;
  cin>>x;
  
  ll a=(ll)x,b=0;
  rep(i,x.size()) b+=x[i];
  
  cout<<(a%b==0?"Yes":"No")<<endl;
}
  
  


Compiler output:
a.cc: In function 'int main()':
a.cc:45:8: error: invalid cast from type 'std::string' {aka 'std::__cxx11::basic_string<char>'} to type 'll' {aka 'long long int'}
   45 |   ll a=(ll)x,b=0;
      |        ^~~~~
a.cc:46:19: error: 'b' was not declared in this scope
   46 |   rep(i,x.size()) b+=x[i];
      |                   ^
a.cc:48:12: error: 'b' was not declared in this scope
   48 |   cout<<(a%b==0?"Yes":"No")<<endl;
      |            ^
Language: C++

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <vector>
#include <queue>
#include <iostream>
#include <set>
#include <map>
#include <string>
#include <algorithm>
#include <stack>
#include <sstream>
#include <list>
 
using namespace std;
 
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define PB push_back
#define PF push_front
 
 
typedef long long int ll;
typedef pair<int, int> Pii;
typedef pair<int, double> Pid;
typedef pair<double, int> Pdi;
typedef pair<double, double> Pdd;
typedef pair<ll, ll> P;
typedef pair<P, ll> PP;
 
 
const ll mod = 1e9+7;
const ll INF = 2e9;
const double epsilon = 1e-7;
const double PI = 3.1415926535;
 
ll gcd(ll a,ll b) {return b?gcd(b,a%b):a;}
 
 
 
int main(){
  string x;
  cin>>x;
  
  ll a=(ll)x,b=0;
  rep(i,x.size()) b+=s[i];
  
  cout<<(a%b==0?"Yes":"No")<<endl;
}
  
  

Compiler output:
a.cc: In function 'int main()':
a.cc:45:8: error: invalid cast from type 'std::string' {aka 'std::__cxx11::basic_string<char>'} to type 'll' {aka 'long long int'}
   45 |   ll a=(ll)x,b=0;
      |        ^~~~~
a.cc:46:19: error: 'b' was not declared in this scope
   46 |   rep(i,x.size()) b+=s[i];
      |                   ^
a.cc:46:22: error: 's' was not declared in this scope
   46 |   rep(i,x.size()) b+=s[i];
      |                      ^
a.cc:48:12: error: 'b' was not declared in this scope
   48 |   cout<<(a%b==0?"Yes":"No")<<endl;
      |            ^
Language: C++

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

int main() {
  
  int N;
  int f = 0;
  int d = 1
  cin >> N;
  int M = N;
  while(M > 0) {
    d *=10;
    f += (M%d)/(d/10);
    M -= M%d;
  }
  if ( N % f == 0 ) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:3: error: expected ',' or ';' before 'cin'
   10 |   cin >> N;
      |   ^~~
Language: C++

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

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


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

#include <bits/stdc++.h>

using namespace std;

class BHarshadNumber {
public:
void solve(std::istream& cin, std::ostream& cout) {
    int n;
    cin >> n;

    int s = 0;
    int d = 1;
    for (int i = 0; i < 9; i++){
        s += (n / d) % 10;
        d *= 10;
    }

    cout << (n % s == 0 ? "Yes" : "No") << endl;
}
};

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include <bits/stdc++.h>
using namespacde std;
int main(){
  int n, m1, m2, m3, m4, m5, m6, m7, m8, m9;
  cin >> n;
  m1=(n/1)%10, m2=(n/10)%10, m3=(n/100)%10, m4=(n/1000)%10, m5=(n/10000)%10;
  m6=(n/100000)%10,m7=(n/1000000)%10, m8=(n/10000000)%10, m9=(n/100000000)%10;
  if(n%(m1+m2+m3+m4+m5+m6+m7+m8+m9)==0){
    cout << "Yes" << endl;
  }
}

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namespacde'
    2 | using namespacde std;
      |       ^~~~~~~~~~
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |   cin >> n;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:9:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    9 |     cout << "Yes" << endl;
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:9:22: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    9 |     cout << "Yes" << endl;
      |                      ^~~~
      |                      std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

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

int main (){
  int N, x;
  cin >> N;
  x = 0;
  for (int i = 0; i < 8; i++){
    x += N(i);
  }
  if(N % x == 0){
    cout << "Yes";
  }else{
    cout << "No";
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:11: error: 'N' cannot be used as a function
    9 |     x += N(i);
      |          ~^~~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:11: error: invalid types 'int[int]' for array subscript
    9 |     x += N[i];
      |           ^
a.cc:11:8: error: lvalue required as left operand of assignment
   11 |   if(N % x = 0){
      |      ~~^~~
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:17:3: error: expected ',' or ';' before 'if'
   17 |   if(flag) {
      |   ^~
a.cc:20:3: error: 'else' without a previous 'if'
   20 |   else {
      |   ^~~~
Language: C++

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

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


Compiler output:
a.cc:18:3: error: extended character 　 is not valid in an identifier
   18 |   else　if(N % A != 0) {
      |   ^
a.cc: In function 'int main()':
a.cc:18:3: error: 'else\U00003000if' was not declared in this scope
   18 |   else　if(N % A != 0) {
      |   ^~~~~~~~
Language: C++

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

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


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

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

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


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

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

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


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

#include"stdafx.h"

#include <iostream>
# include<string>

using namespace std;

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

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



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

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

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


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

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:8:27: error: invalid type argument of unary '*' (have 'int')
    8 |   for(int i = 0; n / (10 ** i) != 0 ; i++, sum += s){
      |                           ^~~
a.cc:9:18: error: invalid type argument of unary '*' (have 'int')
    9 |     s = n / (10 ** i) % 10;
      |                  ^~~
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:8:27: error: invalid type argument of unary '*' (have 'int')
    8 |   for(int i = 0; n / (10 ** i) != 0 ; i++, sum += s){
      |                           ^~~
a.cc:8:51: error: 's' was not declared in this scope
    8 |   for(int i = 0; n / (10 ** i) != 0 ; i++, sum += s){
      |                                                   ^
a.cc:10:5: error: expected initializer before 's'
   10 |     s = n / (10 ** i) % 10;
      |     ^
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:10: error: expected ';' before 'for'
    7 |   sum = 0
      |          ^
      |          ;
    8 |   for(int i = 0; n / (10 ** i) != 0 ; i++, sum += s){
      |   ~~~     
a.cc:8:29: error: 'i' was not declared in this scope
    8 |   for(int i = 0; n / (10 ** i) != 0 ; i++, sum += s){
      |                             ^
a.cc:8:51: error: 's' was not declared in this scope
    8 |   for(int i = 0; n / (10 ** i) != 0 ; i++, sum += s){
      |                                                   ^
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: expected initializer before 'x'
    5 |   int N x=0;
      |         ^
a.cc:6:10: error: 'N' was not declared in this scope
    6 |   cin >> N;
      |          ^
a.cc:8:5: error: 'x' was not declared in this scope
    8 |     x = x+ N % pow(10,i+1) / pow(10,i);
      |     ^
a.cc:10:10: error: 'x' was not declared in this scope
   10 |   if(N % x ==0){
      |          ^
Language: C++

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

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

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:6:8: error: expected '(' before '{' token
    6 |   while{m>=0)
      |        ^
      |        (
a.cc:6:8: error: expected primary-expression before '{' token
a.cc:6:8: error: expected ')' before '{' token
    6 |   while{m>=0)
      |        ^
      |        )
a.cc:6:13: error: expected ';' before ')' token
    6 |   while{m>=0)
      |             ^
      |             ;
Language: C++

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

int main() {
  int n; cin>>n;
int s = n, sum = 0;
while(s) {
sum += s % 10;
s / = 10;
}
cout << (n % sum == 0 ? "Yes" : "No") << endl;
}


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

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

int main() {
  int n; cin>>n;
int s = n, sum = 0;
while(s) {
sum += s % 10;
s / = 10;
}
cout << (n % sum == 0 ? ”Yes” : ”No” ) << endl;
}


Compiler output:
a.cc:11:25: error: extended character ” is not valid in an identifier
   11 | cout << (n % sum == 0 ? ”Yes” : ”No” ) << endl;
      |                         ^
a.cc:11:25: error: extended character ” is not valid in an identifier
a.cc:11:33: error: extended character ” is not valid in an identifier
   11 | cout << (n % sum == 0 ? ”Yes” : ”No” ) << endl;
      |                                 ^
a.cc:11:33: error: extended character ” is not valid in an identifier
a.cc: In function 'int main()':
a.cc:9:5: error: expected primary-expression before '=' token
    9 | s / = 10;
      |     ^
a.cc:11:25: error: '\U0000201dYes\U0000201d' was not declared in this scope
   11 | cout << (n % sum == 0 ? ”Yes” : ”No” ) << endl;
      |                         ^~~~~
a.cc:11:33: error: '\U0000201dNo\U0000201d' was not declared in this scope
   11 | cout << (n % sum == 0 ? ”Yes” : ”No” ) << endl;
      |                                 ^~~~
Language: C++

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

int main() {
  int n; cin>>n;
int s = n, sum = 0;
while(s) {
sum += s % 10;
s / = 10;
}
cout<<(n%sum==0?”Yes”:”No”)<<endl;
}


Compiler output:
a.cc:11:17: error: extended character ” is not valid in an identifier
   11 | cout<<(n%sum==0?”Yes”:”No”)<<endl;
      |                 ^
a.cc:11:17: error: extended character ” is not valid in an identifier
a.cc:11:23: error: extended character ” is not valid in an identifier
   11 | cout<<(n%sum==0?”Yes”:”No”)<<endl;
      |                       ^
a.cc:11:23: error: extended character ” is not valid in an identifier
a.cc: In function 'int main()':
a.cc:9:5: error: expected primary-expression before '=' token
    9 | s / = 10;
      |     ^
a.cc:11:17: error: '\U0000201dYes\U0000201d' was not declared in this scope
   11 | cout<<(n%sum==0?”Yes”:”No”)<<endl;
      |                 ^~~~~
a.cc:11:23: error: '\U0000201dNo\U0000201d' was not declared in this scope
   11 | cout<<(n%sum==0?”Yes”:”No”)<<endl;
      |                       ^~~~
Language: C++

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

int main() {
  int n; cin>>n;
int s = n, sum = 0;
while(s) {
sum += s % 10;
s/=10;
}
cout<<(n%sum==0?”Yes”:”No”)<<endl;


Compiler output:
a.cc:11:17: error: extended character ” is not valid in an identifier
   11 | cout<<(n%sum==0?”Yes”:”No”)<<endl;
      |                 ^
a.cc:11:17: error: extended character ” is not valid in an identifier
a.cc:11:23: error: extended character ” is not valid in an identifier
   11 | cout<<(n%sum==0?”Yes”:”No”)<<endl;
      |                       ^
a.cc:11:23: error: extended character ” is not valid in an identifier
a.cc: In function 'int main()':
a.cc:11:17: error: '\U0000201dYes\U0000201d' was not declared in this scope
   11 | cout<<(n%sum==0?”Yes”:”No”)<<endl;
      |                 ^~~~~
a.cc:11:23: error: '\U0000201dNo\U0000201d' was not declared in this scope
   11 | cout<<(n%sum==0?”Yes”:”No”)<<endl;
      |                       ^~~~
a.cc:11:35: error: expected '}' at end of input
   11 | cout<<(n%sum==0?”Yes”:”No”)<<endl;
      |                                   ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

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

int main() {
  int n;cin>>n;
int s=n,sum=0;
while(s){
sum+=s%10;
s/=10;
}
cout<<(n%sum==0?”Yes”:”No”)<<endl;

Compiler output:
a.cc:11:17: error: extended character ” is not valid in an identifier
   11 | cout<<(n%sum==0?”Yes”:”No”)<<endl;
      |                 ^
a.cc:11:17: error: extended character ” is not valid in an identifier
a.cc:11:23: error: extended character ” is not valid in an identifier
   11 | cout<<(n%sum==0?”Yes”:”No”)<<endl;
      |                       ^
a.cc:11:23: error: extended character ” is not valid in an identifier
a.cc: In function 'int main()':
a.cc:11:17: error: '\U0000201dYes\U0000201d' was not declared in this scope
   11 | cout<<(n%sum==0?”Yes”:”No”)<<endl;
      |                 ^~~~~
a.cc:11:23: error: '\U0000201dNo\U0000201d' was not declared in this scope
   11 | cout<<(n%sum==0?”Yes”:”No”)<<endl;
      |                       ^~~~
a.cc:11:35: error: expected '}' at end of input
   11 | cout<<(n%sum==0?”Yes”:”No”)<<endl;
      |                                   ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
main () {
  int N;
  cin >> N;
  int a1, a2, a3, a4, a5, a6 
  a1 = N / 100000000;
  

Compiler output:
a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    3 | main () {
      | ^~~~
a.cc: In function 'int main()':
a.cc:7:3: error: expected initializer before 'a1'
    7 |   a1 = N / 100000000;
      |   ^~
a.cc:7:22: error: expected '}' at end of input
    7 |   a1 = N / 100000000;
      |                      ^
a.cc:3:9: note: to match this '{'
    3 | main () {
      |         ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:4:5: error: 'cin' was not declared in this scope
    4 |     cin >> N;
      |     ^~~
a.cc:11:9: error: 'cout' was not declared in this scope
   11 |         cout << "Yes" << endl;
      |         ^~~~
a.cc:11:26: error: 'endl' was not declared in this scope
   11 |         cout << "Yes" << endl;
      |                          ^~~~
a.cc:14:9: error: 'cout' was not declared in this scope
   14 |         cout << "No" << endl;
      |         ^~~~
a.cc:14:25: error: 'endl' was not declared in this scope
   14 |         cout << "No" << endl;
      |                         ^~~~
Language: C++

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

int N;

cin >> N;

int a;

int c = 0;

int d = N;

for(int i = 0; i < 8; i++){

a = d % 10; //一番下の数をだす

c += a;　　//桁数の合計

d /= 10;  //一番下の数を除いた数



}

if(N % c == 0){

cout << "Yes" << endl;

}else{

cout << "No" << endl;

}









}

Compiler output:
a.cc:20:8: error: extended character 　 is not valid in an identifier
   20 | c += a;　　//桁数の合計
      |        ^
a.cc:20:8: error: extended character 　 is not valid in an identifier
a.cc: In function 'int main()':
a.cc:20:8: error: '\U00003000\U00003000' was not declared in this scope
   20 | c += a;　　//桁数の合計
      |        ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int sumfind(int n){
  int sum=0;
  while(n>0){
    sum += n%10;
    n = n/10;
  }
  return sum;
}

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

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

#include <stdio.h>

int main(void){
 int x,sum=0,a;
 scanf("%d",&x);
  a=x;
 while(x)
  sum+=a%10;
  a=a/10;
}
if(sum%x==0){
	printf("yes");
}else{
	printf("no");
}

Compiler output:
a.cc:11:1: error: expected unqualified-id before 'if'
   11 | if(sum%x==0){
      | ^~
a.cc:13:2: error: expected unqualified-id before 'else'
   13 | }else{
      |  ^~~~
Language: C++

#include<stdio.h>
#include<stdio.h>
 
int main(void){
	char s[8];
  	int x=0;
  	scanf("%s",s);
    for(int i=0;i<strlen(s);i++){
    	x+=(int)s[i];
    }
  	if(x%(int)s==0){
    	printf("yes");
    }else{
    	printf("no");
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:19: error: 'strlen' was not declared in this scope
    8 |     for(int i=0;i<strlen(s);i++){
      |                   ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<stdio.h>
  +++ |+#include <cstring>
    2 | #include<stdio.h>
a.cc:11:14: error: cast from 'char*' to 'int' loses precision [-fpermissive]
   11 |         if(x%(int)s==0){
      |              ^~~~~~
Language: C++

#include<stdio.h>
#include<stdio.h>
 
int main(void){
	char s[8];
  	int x=0;
  	scanf("%s",s[]);
    for(int i=0;i<strlen(s);i++){
    	x+=(int)s[i];
    }
  	if(x%(int)s==0){
    	printf("yes");
    }else{
    	printf("no");
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:22: error: expected primary-expression before ']' token
    7 |         scanf("%s",s[]);
      |                      ^
a.cc:8:19: error: 'strlen' was not declared in this scope
    8 |     for(int i=0;i<strlen(s);i++){
      |                   ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<stdio.h>
  +++ |+#include <cstring>
    2 | #include<stdio.h>
a.cc:11:14: error: cast from 'char*' to 'int' loses precision [-fpermissive]
   11 |         if(x%(int)s==0){
      |              ^~~~~~
Language: C++

#include<stdio.h>
#include<stdio.h>
 
int main(void){
	char s[8];
  	int x=0;
  	scanf("%s",s[]);
    for(int i=0;i<strlen(s);i++){
    	x+=(int)s[i]
    }
  	if(x%(int)s==0){
    	printf("yes");
    }else{
    	printf("no");
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:22: error: expected primary-expression before ']' token
    7 |         scanf("%s",s[]);
      |                      ^
a.cc:8:19: error: 'strlen' was not declared in this scope
    8 |     for(int i=0;i<strlen(s);i++){
      |                   ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<stdio.h>
  +++ |+#include <cstring>
    2 | #include<stdio.h>
a.cc:9:21: error: expected ';' before '}' token
    9 |         x+=(int)s[i]
      |                     ^
      |                     ;
   10 |     }
      |     ~                
a.cc:11:14: error: cast from 'char*' to 'int' loses precision [-fpermissive]
   11 |         if(x%(int)s==0){
      |              ^~~~~~
Language: C++

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

int main(void){
	char s[8];
  	int x=;
  	scanf("%s",s[]);
    for(i=0;i<strlen(s);i++){
    	x+=(int)s[i]
    }
  	if(x%(int)s==0){
    	printf("yes");
    }else{
    	printf("no");
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:15: error: expected primary-expression before ';' token
    6 |         int x=;
      |               ^
a.cc:7:22: error: expected primary-expression before ']' token
    7 |         scanf("%s",s[]);
      |                      ^
a.cc:8:9: error: 'i' was not declared in this scope
    8 |     for(i=0;i<strlen(s);i++){
      |         ^
a.cc:8:15: error: 'strlen' was not declared in this scope
    8 |     for(i=0;i<strlen(s);i++){
      |               ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<stdio.h>
  +++ |+#include <cstring>
    2 | #include<stdio.h>
a.cc:11:14: error: cast from 'char*' to 'int' loses precision [-fpermissive]
   11 |         if(x%(int)s==0){
      |              ^~~~~~
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for(ll i = 0; i < (ll)n; i++)
#define FOR(i, a, b) for(ll i = (a); i < (ll)b; i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define INF 1000000000000000
using namespace std;
typedef long long ll;
typedef double db;
typedef string str;
typedef pair<ll, ll> p;
constexpr int MOD = 1000000007;
template <class T> inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}
template <class T> inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}

void print(const std::vector<int> &v) {
    std::for_each(v.begin(), v.end(), [](int x) { std::cout << x << " "; });
    std::cout << std::endl;
}

int main() {
    string N;
    int fx = 0;
    REP(i, N.size()) { fx += (N[i] - '0'); }
    int n = stoi(N);
    if(n % fx == 0) {
        cout << "Yes" << endl;
        return 0'
    }
    cout << "No" << endl;
    return 0;
}

Compiler output:
a.cc:39:17: warning: missing terminating ' character
   39 |         return 0'
      |                 ^
a.cc:39:17: error: missing terminating ' character
a.cc: In function 'int main()':
a.cc:39:17: error: expected ';' before '}' token
   39 |         return 0'
      |                 ^
      |                 ;
   40 |     }
      |     ~
Language: C++

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

int main(){
  int n;
  cin >> n;
  
  int sum=0;
  
  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:15:8: error: lvalue required as left operand of assignment
   15 |   if (n%sum = 0){
      |       ~^~~~
Language: C++

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

Compiler output:
a.cc: In function 'int maiin()':
a.cc:18:1: warning: no return statement in function returning non-void [-Wreturn-type]
   18 | }
      | ^
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

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

Compiler output:
a.cc: In function 'int maiin()':
a.cc:17:1: warning: no return statement in function returning non-void [-Wreturn-type]
   17 | }
      | ^
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

int main(){
  long long int n,x,r;
  cin>>n;
  
  x=n;
  r=0;
  while(x!=0){
  r+=x%10;
  x=x/10;  
  }
  
  if(n%r==0)
    cout<<"yes"<<endl;
  else
    cout<<"no"<<endl;
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:3:3: error: 'cin' was not declared in this scope
    3 |   cin>>n;
      |   ^~~
a.cc:13:5: error: 'cout' was not declared in this scope
   13 |     cout<<"yes"<<endl;
      |     ^~~~
a.cc:13:18: error: 'endl' was not declared in this scope
   13 |     cout<<"yes"<<endl;
      |                  ^~~~
a.cc:15:5: error: 'cout' was not declared in this scope
   15 |     cout<<"no"<<endl;
      |     ^~~~
a.cc:15:17: error: 'endl' was not declared in this scope
   15 |     cout<<"no"<<endl;
      |                 ^~~~
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:13:21: error: expected ';' before 'if'
   13 |     B=std::pow(10,i)
      |                     ^
      |                     ;
   14 |     if (i==0) {
      |     ~~               
a.cc:16:7: error: 'else' without a previous 'if'
   16 |     } else {
      |       ^~~~
Language: C++

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

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



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



Compiler output:
a.cc: In function 'int main()':
a.cc:9:15: error: no matching function for call to 'stoi(__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type&)'
    9 |     ha += stoi(n[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 t = N,c = 0;
  
  while(){
    c = c + (t % 10);
    t = t / 10;
  }
  if(N % c == 0){
    cout << "Yes" << endl;
  }else if(N % c !=){
    cout << "No" << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: expected primary-expression before ')' token
   10 |   while(){
      |         ^
a.cc:16:20: error: expected primary-expression before ')' token
   16 |   }else if(N % c !=){
      |                    ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b;
  b = 0;
  for (int e = 0;e <
   e = a / 10
  for (
      b += a / 10
    ^]%|%~*|\^^^$$>,^$]>>~^$$~$^^]^$***^~^*%%~>{>>>~$$]*
      taya

Compiler output:
a.cc:10:13: error: stray '\' in program
   10 |     ^]%|%~*|\^^^$$>,^$]>>~^$$~$^^]^$***^~^*%%~>{>>>~$$]*
      |             ^
a.cc: In function 'int main()':
a.cc:6:20: error: lvalue required as left operand of assignment
    6 |   for (int e = 0;e <
      |                  ~~^
    7 |    e = a / 10
      |    ~                
a.cc:7:14: error: expected ';' before 'for'
    7 |    e = a / 10
      |              ^
      |              ;
    8 |   for (
      |   ~~~         
a.cc:8:3: error: expected primary-expression before 'for'
    8 |   for (
      |   ^~~
a.cc:7:14: error: expected ')' before 'for'
    7 |    e = a / 10
      |              ^
      |              )
    8 |   for (
      |   ~~~         
a.cc:6:7: note: to match this '('
    6 |   for (int e = 0;e <
      |       ^
a.cc:10:6: error: expected primary-expression before ']' token
   10 |     ^]%|%~*|\^^^$$>,^$]>>~^$$~$^^]^$***^~^*%%~>{>>>~$$]*
      |      ^
a.cc:11:11: error: expected primary-expression at end of input
   11 |       taya
      |           ^
a.cc:11:11: error: expected ';' at end of input
   11 |       taya
      |           ^
      |           ;
a.cc:11:11: error: expected primary-expression at end of input
a.cc:11:11: error: expected ')' at end of input
   11 |       taya
      |           ^
      |           )
a.cc:8:7: note: to match this '('
    8 |   for (
      |       ^
a.cc:11:11: error: expected statement at end of input
   11 |       taya
      |           ^
a.cc:11:11: error: expected '}' at end of input
a.cc:3:12: note: to match this '{'
    3 | int main() {
      |            ^
Language: C++

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

int main () {
  char N;
  cin >> N;
  
  int k = 0;
  
  for (int i = 0; i < N.size(); i++){
    k += N.at(i);
  }
  
  
  if (N % k == 0){
    cout << "Yes" << endl;
  }
  else{
  cout << "No" << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:25: error: request for member 'size' in 'N', which is of non-class type 'char'
   10 |   for (int i = 0; i < N.size(); i++){
      |                         ^~~~
a.cc:11:12: error: request for member 'at' in 'N', which is of non-class type 'char'
   11 |     k += N.at(i);
      |            ^~
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:10:25: error: request for member 'size' in 'N', which is of non-class type 'int'
   10 |   for (int i = 0; i < N.size(); i++){
      |                         ^~~~
a.cc:11:12: error: request for member 'at' in 'N', which is of non-class type 'int'
   11 |     k += N.at(i)
      |            ^~
Language: C++

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

int main () {
  int N;
  cin >> N;
  
  int a, b, c, d, e, f, g, h, i, j, k;
  
  a = N/100000000;
  b = N%100000000/10000000;
  c = N%100000000%10000000/1000000;
  d = N%100000000%10000000%1000000/100000;
  e = N%100000000%10000000%1000000%100000/10000;
  f = N%100000000%10000000%1000000%100000%10000/1000;
  g = N%100000000%10000000%1000000%100000%10000%1000/100;
  h = N%100000000%10000000%1000000%100000%10000%1000&100/10;
  i = N%10;
  j = a+b+c+d+e+f+g+h+i;
  k = N%j
    
  if (k == 0){
    cout << "Yes" << endl;
  }
  else {
  cout << "No" << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:10: error: expected ';' before 'if'
   20 |   k = N%j
      |          ^
      |          ;
   21 | 
   22 |   if (k == 0){
      |   ~~      
a.cc:25:3: error: 'else' without a previous 'if'
   25 |   else {
      |   ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  cin >> N;
  int sum = 0;
  for(int i = 0; i < N.size(); i++){
    sum += N.at(i);
      }
  if( N % sum = 0 ){
    cout << "yes";
  }
  else{
    cout << "No";
    }
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:8:24: error: request for member 'size' in 'N', which is of non-class type 'int'
    8 |   for(int i = 0; i < N.size(); i++){
      |                        ^~~~
a.cc:9:14: error: request for member 'at' in 'N', which is of non-class type 'int'
    9 |     sum += N.at(i);
      |              ^~
a.cc:11:9: error: lvalue required as left operand of assignment
   11 |   if( N % sum = 0 ){
      |       ~~^~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  cin >> N;
  int sum = 0;
  for(int i = 0; i < N.size(); i++){
    sum += N.at(i);
      }
  if( N % sum = 0 ){
    cout << "yes";
  }
  else{
    cout << "No"
    }
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:8:24: error: request for member 'size' in 'N', which is of non-class type 'int'
    8 |   for(int i = 0; i < N.size(); i++){
      |                        ^~~~
a.cc:9:14: error: request for member 'at' in 'N', which is of non-class type 'int'
    9 |     sum += N.at(i);
      |              ^~
a.cc:11:9: error: lvalue required as left operand of assignment
   11 |   if( N % sum = 0 ){
      |       ~~^~~~~
a.cc:15:17: error: expected ';' before '}' token
   15 |     cout << "No"
      |                 ^
      |                 ;
   16 |     }
      |     ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  cin >> N;
  int sum = 0;
  for(int i = 0; i < N.size(); i++){
    sum += N.at(i);
      }
  if( N % sum = 0 ){
    cont << "yes";
  }
  else{
    cout << "No"
    }
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:8:24: error: request for member 'size' in 'N', which is of non-class type 'int'
    8 |   for(int i = 0; i < N.size(); i++){
      |                        ^~~~
a.cc:9:14: error: request for member 'at' in 'N', which is of non-class type 'int'
    9 |     sum += N.at(i);
      |              ^~
a.cc:11:9: error: lvalue required as left operand of assignment
   11 |   if( N % sum = 0 ){
      |       ~~^~~~~
a.cc:12:5: error: 'cont' was not declared in this scope; did you mean 'const'?
   12 |     cont << "yes";
      |     ^~~~
      |     const
a.cc:15:17: error: expected ';' before '}' token
   15 |     cout << "No"
      |                 ^
      |                 ;
   16 |     }
      |     ~
Language: C++

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

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

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N, i;
  int sum=0;
    cin >> N;
  while (N < 2;){
    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:8:15: error: expected ')' before ';' token
    8 |   while (N < 2;){
      |         ~     ^
      |               )
a.cc:8:16: error: expected primary-expression before ')' token
    8 |   while (N < 2;){
      |                ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:20: error: expected ';' before '}' token
    9 |     sum += N%(10*i)
      |                    ^
      |                    ;
   10 |   }
      |   ~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:21: error: expected ';' before '}' token
    9 |     sum  += N%(10*i)
      |                     ^
      |                     ;
   10 |   }
      |   ~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:29: error: expected primary-expression before ';' token
    8 |   for (i = 1; N/10*i == 0 < ; i*10){
      |                             ^
a.cc:9:21: error: expected ';' before '}' token
    9 |     sum  += N%(10*i)
      |                     ^
      |                     ;
   10 |   }
      |   ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  cin >> N;
  int x = 0;
  int y=0;  
  for (i = 100000000; i = 1 ; i/10){
 x += (N - y)/i;
 y = N - x*i;
}
  if (N % x == 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 = 100000000; i = 1 ; i/10){
      |        ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:7: error: redeclaration of 'int x'
    7 |   int x = 0;
      |       ^
a.cc:5:10: note: 'int x' previously declared here
    5 |   int N, x;
      |          ^
a.cc:9:8: error: 'i' was not declared in this scope
    9 |   for (i = 100000000; i = 1 ; i/10){
      |        ^
Language: C++

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



Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  int sum = 0;
  for(i = 1; i < 100000001; i *= 10) {
    sum += N / i % 10;
  }
  if(N % sum == 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 = 1; i < 100000001; i *= 10) {
      |       ^
Language: C++

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

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

    int count = 0;
    int A = N;
    for(int i = 1; i < 10; i++){
        int n = A % 10;
        count += n;
        int A /= 10;
    }

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

Compiler output:
a.cc: In function 'int main()':
a.cc:13:15: error: expected initializer before '/=' token
   13 |         int A /= 10;
      |               ^~
Language: C

#include <stdio.h>

int sum(long long int number_n) {
  if(number_n < 10) {
    return number_n;
  } else {
    return (number_n % 10) + sum(number_n / 10);
  }
}

int main() {
  int sum;
  long long int number_n;
  scanf("%lld", &number_n);
  sum = sum(number_n);
  if(number_n % sum == 0) {
    printf("Yes\n");
  } else {
    printf("No\n");
  }
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:15:9: error: called object 'sum' is not a function or function pointer
   15 |   sum = sum(number_n);
      |         ^~~
main.c:12:7: note: declared here
   12 |   int sum;
      |       ^~~
Language: C++

#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <numeric>
#include <tuple>
#include <stack>

#define rep(i,n) for (int i = 0; i < (n); ++i)
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define print(s) cout << s << endl
typedef long long ll;
using namespace std;

int ctoi(char c) {
	if (c >= '0' && c <= '9') {
		return c - '0';
	}
	return 0;
}

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

Compiler output:
a.cc: In function 'int main()':
a.cc:32:26: error: expected ')' before ';' token
   32 |         cout << (n%x == 0; "Yes": "No") << endl;
      |                 ~        ^
      |                          )
a.cc:32:33: error: expected ';' before ':' token
   32 |         cout << (n%x == 0; "Yes": "No") << endl;
      |                                 ^
      |                                 ;