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

#include <iostream>
#include <string>

using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:13:14: error: invalid conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const char*' [-fpermissive]
   13 |     n += atoi(sn[i]);
      |          ~~~~^~~~~~~
      |              |
      |              __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char}
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/c++/14/ext/string_conversions.h:43,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/stdlib.h:105:30: note:   initializing argument 1 of 'int atoi(const char*)'
  105 | extern int atoi (const char *__nptr)
      |                  ~~~~~~~~~~~~^~~~~~
Language: C++

#include <iostream>
#include <string>

using namespace std;

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:127: error: expected ';' before '}' token
    6 |   b=a/100000000+a%1000000000/10000000+a%10000000/1000000+a%1000000/100000+a%100000/10000+a%10000/1000+a%1000/100+a%100/10+a%10
      |                                                                                                                               ^
      |                                                                                                                               ;
......
    9 | }
      | ~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:141: error: expected ';' before 'if'
    6 |   b=a/100000000+(a%1000000000)/10000000+(a%10000000)/1000000+(a%1000000)/100000+(a%100000)/10000+(a%10000)/1000+(a%1000)/100+(a%100)/10+a%10
      |                                                                                                                                             ^
      |                                                                                                                                             ;
    7 |   if(a%b==0)cout<<"true"<<endl;
      |   ~~                                                                                                                                         
a.cc:8:3: error: 'else' without a previous 'if'
    8 |   else cout<<"false"<<endl;
      |   ^~~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:127: error: expected ';' before 'if'
    6 |   b=a/100000000+a%1000000000/10000000+a%10000000/1000000+a%1000000/100000+a%100000/10000+a%10000/1000+a%1000/100+a%100/10+a%10
      |                                                                                                                               ^
      |                                                                                                                               ;
    7 |   if(a%b==0)cout<<"true"<<endl;
      |   ~~                                                                                                                           
a.cc:8:3: error: 'else' without a previous 'if'
    8 |   else cout<<"false"<<endl;
      |   ^~~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:58: error: expected ';' before 'if'
    7 |     +a%100000/10000+a%10000/1000+a%1000/100+a%100/10+a%10
      |                                                          ^
      |                                                          ;
    8 |   if(a%b==0)cout<<"true"<<endl;
      |   ~~                                                      
a.cc:9:3: error: 'else' without a previous 'if'
    9 |   else cout<<"false"<<endl;
      |   ^~~~
Language: C++

#include <bits/stdc++.h>
#define rep(i,a,n)  for (int i=(int)(a); i<=(int)(n); ++i)
#define rrep(i,a,n) for (int i=(int)(a); i>=(int)(n); --i)
#define debug(x) cerr << #x << " = " << x << "\n"
#define debugv(x) rep(f, 0, (x.size()-1)) cerr << x[f] << (f == (x.size() - 1) ? "\n" : " ")
#define all(x) x.begin(),x.end()
#define int long long
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int INF = ((1LL << 30) + (1LL << 29));
const int MOD = 1000000007;

//=============================
int N,M,K,X,Y;
int a,b,c,d;
string S,T;
vector<int> A,B;
//=============================
void input()
{
    cin>>N;
}
//=============================
int func(int x){
    int ret=0;
    while(x){
        ret += x%10;
        x /= 10;
    }
    return ret;
}
/*
 - 樹形図をかく
*/
//=============================
void solve()
{
    cout<<(x%func(x) ? "No" : "Yes")<<endl;

}
//=============================
signed main()
{
    input();
    solve();
    return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:39:12: error: 'x' was not declared in this scope
   39 |     cout<<(x%func(x) ? "No" : "Yes")<<endl;
      |            ^
Language: C++

/*
　　　  ∧＿∧　やあ
　　 （´・ω・｀)　　　　　/　　　　　ようこそ、バーボンハウスへ。
　　 ／∇y:::::＼　　　 [￣]　　　　　このテキーラはサービスだから、まず飲んで落ち着いて欲しい。
　　 |:⊃:|:::::|　　　|──|
￣￣￣￣￣￣￣￣￣￣￣￣￣￣￣￣￣|　うん、「また」なんだ。済まない。
￣￣￣￣￣￣￣￣￣￣￣￣￣￣￣|￣　  仏の顔もって言うしね、謝って許してもらおうとも思っていない。
￣￣￣￣￣￣￣￣￣￣￣￣￣￣／|
　　　　∇　∇　∇　∇　　　／.／|　　　でも、この提出を見たとき、君は、きっと言葉では言い表せない
　　　　┴　┴　┴　┴　／ ／　  |　　　「ときめき」みたいなものを感じてくれたと思う。
￣￣￣￣￣￣￣￣￣￣|／　　  |　　　殺伐としたコンテストの中で、そういう気持ちを忘れないで欲しい
￣￣￣￣￣￣￣￣￣￣　　　　 |　　　そう思って、この提出を投げたんだ。
　　　(⊆⊇)　(⊆⊇)　(⊆⊇)　　|
　    ||　　 ||　　||　　|　　　 じゃあ、判定を聞こうか。
　　.／|＼　／|＼ ／|＼
*/

#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <array>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdio>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
#define fst first
#define snd second
#define mp make_pair
#define ALL(obj) (obj).begin(),(obj).end()
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i = (b-1);i>=a;i--)
#define REP(i,n)  FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n) 
#define SIZE(x) ((int)(x).size())
#define debug(x) cerr << #x << " -> " << x << " (line:" << __LINE__ << ")" << '\n';
#define debugpair(x, y) cerr << "(" << #x << ", " << #y << ") -> (" << x << ", " << y << ") (line:" << __LINE__ << ")" << '\n';
typedef long long lint;
typedef pair<int, int> pint;
typedef pair<lint, lint> plint;
typedef vector<lint> vec;
typedef vector<vector<lint>> matrix;
typedef priority_queue<lint> p_que;
typedef priority_queue<lint, vector<lint>, greater<lint>> p_que_rev;
const lint INF = INT_MAX;
const lint LINF = LLONG_MAX;
const lint MOD = 1000000000 + 7;
const double EPS = 1e-9;
const double PI = acos(-1);
const int di[]{0, -1, 0, 1, -1, -1, 1, 1};
const int dj[]{1, 0, -1, 0, 1, -1, -1, 1};

lint gcd(lint a, lint b) {
    lint r;
    while (b != 0) {
        r = a % b;
        a = b; 
        b = r;
    }
    return a;
}

lint lcm(lint a, lint b) {
    return (a / gcd(a, b)) * b;
}

lint power(lint x, lint n, lint mod = MOD) {
    lint ret = 1;
    while(n > 0) {
        if(n & 1){
            (ret *= x) %= mod;
        }
        (x *= x) %= mod;
        n >>= 1;
    }
    return ret;
}

vector<lint> make_power(int n, lint base){
    lint num = 1;
    vector<lint> ret;
    for (int i=0; i<=n; ++i){
        ret.push_back(num);
        num *= base;
    }
    return ret;
}

int main()
{
    cin.tie(0);
    ios_base::sync_with_stdio(false);
    int n;
    cin >> n;
    int dig_sum = 0;
    int m = n;
    while(m > 0){
        dig_sum += m % 10;
        m /= 10;
    }
    if(n % dig_sum == 0){
        cout << "Yes" << endl;
    }
    else {
    cout << "No" << endl;
    return 0;
}

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

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:19:26: error: expected '}' at end of input
   19 |     cout << "No" << endl;
      |                          ^
a.cc:5:1: note: to match this '{'
    5 | {
      | ^
Language: C++

#include<iostream>
using namespace std ;

int main(){
  int X,X_const,fX ;
  
  cin >> X ;
  X_const
  
  fX=0 ;
  
  while(1){
    if(X == 0){break ;}
    fX = fX + X % 10 ;
    X = (X - X%10)/10 ;
  }

  if(X%fX_const == 0) cout << Yes << endl;
  else cout << No << endl ;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:10: error: expected ';' before 'fX'
    8 |   X_const
      |          ^
      |          ;
    9 | 
   10 |   fX=0 ;
      |   ~~      
a.cc:18:8: error: 'fX_const' was not declared in this scope; did you mean 'X_const'?
   18 |   if(X%fX_const == 0) cout << Yes << endl;
      |        ^~~~~~~~
      |        X_const
a.cc:18:31: error: 'Yes' was not declared in this scope
   18 |   if(X%fX_const == 0) cout << Yes << endl;
      |                               ^~~
a.cc:19:16: error: 'No' was not declared in this scope
   19 |   else cout << No << endl ;
      |                ^~
Language: C++

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

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

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

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

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

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

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

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

#include <iostream>
using namespace std;

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

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

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:11:14: error: expected primary-expression before 'double'
   11 |     T = N % (double pow(double 10, double i));
      |              ^~~~~~
a.cc:11:14: error: expected ')' before 'double'
   11 |     T = N % (double pow(double 10, double i));
      |             ~^~~~~~
      |              )
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:11:17: error: invalid type argument of unary '*' (have 'int')
   11 |     T = N % (10**i);
      |                 ^~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'S' was not declared in this scope
    7 |   S = 0;
      |   ^
a.cc:8:9: error: 'T' was not declared in this scope
    8 |   while(T = N) {
      |         ^
Language: C++

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

Compiler output:
a.cc:24:3: error: expected unqualified-id before 'if'
   24 |   if(C % sum == 0){
      |   ^~
a.cc:28:3: error: expected unqualified-id before 'else'
   28 |   else if(C % sum){
      |   ^~~~
a.cc:32:1: error: expected declaration before '}' token
   32 | }
      | ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:13:3: error: expected ',' or ';' before 'for'
   13 |   for(i;N == 0; i++){
      |   ^~~
a.cc:13:20: error: expected ';' before ')' token
   13 |   for(i;N == 0; i++){
      |                    ^
      |                    ;
a.cc: At global scope:
a.cc:24:3: error: expected unqualified-id before 'if'
   24 |   if(C % sum == 0){
      |   ^~
a.cc:28:3: error: expected unqualified-id before 'else'
   28 |   else if(C % sum){
      |   ^~~~
a.cc:32:1: error: expected declaration before '}' token
   32 | }
      | ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:26:10: error: expected '(' before '{' token
   26 |   else if{
      |          ^
      |          (
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:15:13: error: expected ';' before '}' token
   15 |       B *=10
      |             ^
      |             ;
   16 |     }
      |     ~        
a.cc:17:11: error: expected ';' before 'sum'
   17 |     A %= B
      |           ^
      |           ;
   18 |     sum += A;
      |     ~~~    
a.cc:26:21: error: expected primary-expression before '=' token
   26 |   else if(C % sum !== 0){
      |                     ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:17: error: expected ';' before '<' token
    9 |   for( int i=0,i<9,i++){
      |                 ^
      |                 ;
a.cc:9:17: error: expected primary-expression before '<' token
a.cc:9:23: error: expected ';' before ')' token
    9 |   for( int i=0,i<9,i++){
      |                       ^
      |                       ;
a.cc:16:17: error: expected ';' before 'endl'
   16 |     cout << "No" endl;
      |                 ^~~~~
      |                 ;
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n;
  cin >> n;
  int m=n;
  int s=0;
  for(i=0,i<9,i++){
    s+=m%10;
    m/=10;
  }
  if(n%s ==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,i<9,i++){
      |       ^
a.cc:13:3: error: expected primary-expression before 'if'
   13 |   if(n%s ==0){
      |   ^~
a.cc:12:4: error: expected ';' before 'if'
   12 |   }
      |    ^
      |    ;
   13 |   if(n%s ==0){
      |   ~~
a.cc:13:3: error: expected primary-expression before 'if'
   13 |   if(n%s ==0){
      |   ^~
a.cc:12:4: error: expected ')' before 'if'
   12 |   }
      |    ^
      |    )
   13 |   if(n%s ==0){
      |   ~~
a.cc:9:6: note: to match this '('
    9 |   for(i=0,i<9,i++){
      |      ^
a.cc:16:17: error: expected ';' before 'endl'
   16 |     cout << "No" endl;
      |                 ^~~~~
      |                 ;
Language: C++

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

int main() {
  int N, sum, x;
  cin >> N;
  sum = 0;
  x = N;

  for (int i = 8; i >= 0; i--) {
    
    if (x/(10^i) != 0){
      sum += x/(10^i);
      x -= x/(10^i)*(10^i)
    }  
  }
  cout << sum << endl;
}


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

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

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

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

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

int main() {
  int N;
  cin >> N;
  int x = 0

  for (int i = 0; i < 8; i++){
    int a;
    a = (N/(10^i))%10;
    x += a
  }
  
  if ( N%x == 0){
    cout << "Yes" << endl;
  }
  
  else{
    cout << "No" << endl;
  
  }
  
      
    

Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: expected ',' or ';' before 'for'
    9 |   for (int i = 0; i < 8; i++){
      |   ^~~
a.cc:9:19: error: 'i' was not declared in this scope
    9 |   for (int i = 0; i < 8; i++){
      |                   ^
a.cc:22:4: error: expected '}' at end of input
   22 |   }
      |    ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
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, x, y, sum;
    cin >> N;
    y = N;
    sum = 0;
    rep(i,  8){
        x = (N % (10 ** i)) / (10 ** (i - 1));
        sum += x;
        N -= N % (10 ** i)
        if(x == N){break;}
    }
    if(y % sum == 0){
        cout << "Yes" <<endl;
    }
    else{
        cout << "No" << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:23: error: invalid type argument of unary '*' (have 'int')
   10 |         x = (N % (10 ** i)) / (10 ** (i - 1));
      |                       ^~~
a.cc:10:36: error: invalid type argument of unary '*' (have 'int')
   10 |         x = (N % (10 ** i)) / (10 ** (i - 1));
      |                                    ^~~~~~~~~
a.cc:12:23: error: invalid type argument of unary '*' (have 'int')
   12 |         N -= N % (10 ** i)
      |                       ^~~
Language: C++

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

int main() {
  int n;
  cin >> n;
  
  string sn = to_string(n);
  
  int len;
  len = sn.length();
  
  int fx = 0;
  for (int i = 0; i < len; i++) {
    fx += atoi(sn[i].c_str());
  }
  
  if (n % fx == 0) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:22: error: request for member 'c_str' in 'sn.std::__cxx11::basic_string<char>::operator[](((std::__cxx11::basic_string<char>::size_type)i))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}
   15 |     fx += atoi(sn[i].c_str());
      |                      ^~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n,sum=0;
  cin >> n;
  
  string sn = to_string(n);
  int length = sn.size();
  for(int i = 0; i<length; i++){
    sum += stoi(sn[i]);
  }
  if(n%sum){
    cout << "Yes";
  }else{
    cout << "No";
  }
 

}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:16: error: no matching function for call to 'stoi(__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type&)'
   11 |     sum += stoi(sn[i]);
      |            ~~~~^~~~~~~
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:4164:3: note: candidate: 'int std::__cxx11::stoi(const std::string&, std::size_t*, int)'
 4164 |   stoi(const string& __str, size_t* __idx = 0, int __base = 10)
      |   ^~~~
/usr/include/c++/14/bits/basic_string.h:4164:22: note:   no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const std::string&' {aka 'const std::__cxx11::basic_string<char>&'}
 4164 |   stoi(const string& __str, size_t* __idx = 0, int __base = 10)
      |        ~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:4432:3: note: candidate: 'int std::__cxx11::stoi(const std::wstring&, std::size_t*, int)'
 4432 |   stoi(const wstring& __str, size_t* __idx = 0, int __base = 10)
      |   ^~~~
/usr/include/c++/14/bits/basic_string.h:4432:23: note:   no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const std::wstring&' {aka 'const std::__cxx11::basic_string<wchar_t>&'}
 4432 |   stoi(const wstring& __str, size_t* __idx = 0, int __base = 10)
      |        ~~~~~~~~~~~~~~~^~~~~
Language: C++

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

int main() {
  int N, sum, order;
  bool end;
  cin >> N;
  sum = 0;
  order = 1;
  loop = false;
  for (int i = 0; i < 8; i++) {
    order *= 10;
    if (order > N)
      end = true;
      break;
    else
      sum += N / order % 10
    if (end)
      break;
  }
  if (N % sum == 0)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:3: error: 'loop' was not declared in this scope
   10 |   loop = false;
      |   ^~~~
a.cc:16:5: error: 'else' without a previous 'if'
   16 |     else
      |     ^~~~
a.cc:17:28: error: expected ';' before 'if'
   17 |       sum += N / order % 10
      |                            ^
      |                            ;
   18 |     if (end)
      |     ~~
Language: C++

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

int main() {

  int i, N, fx=0;
  string str;
  
  cin >> N;
  
  str = N;
  
  for (i = 0; str[i] != NUL; i++) {
    fx += str[i];
  }
  
  if (N % fx == 0) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }

}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:25: error: 'NUL' was not declared in this scope; did you mean 'NULL'?
   13 |   for (i = 0; str[i] != NUL; i++) {
      |                         ^~~
      |                         NULL
Language: C++

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

int main() {

  int i, N, fx=0;
  string str;
  
  cin >> N;
  
  str = N;
  
  for (i = 0; str[i] != "\0"; i++) {
    fx += str[i];
  }
  
  if (N % fx == 0) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }

}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:22: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   13 |   for (i = 0; str[i] != "\0"; i++) {
Language: C++

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

int main() {

  int N, fx=0;
  string str;
  
  cin >> N;
  
  str = N;
  
  for (i = 0; str[i] != "\0"; i++) {
    fx += str[i];
  }
  
  if (x %fx == 0) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }

}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:8: error: 'i' was not declared in this scope
   13 |   for (i = 0; str[i] != "\0"; i++) {
      |        ^
a.cc:17:7: error: 'x' was not declared in this scope; did you mean 'fx'?
   17 |   if (x %fx == 0) {
      |       ^
      |       fx
Language: C++

#include <iostream>
using namespace std;

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

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

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

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

    int f = 0;
    rep2(i, 9) {
        f += int((n % pow(10, i)) / pow(10, (i - 1)));
    }

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


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

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

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

    int f = 0;
    rep(i, 9) {
        f += int((n % pow(10, i)) / pow(10, (i - 1)));
    }

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


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

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

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

    int f = 0;
    rep(i, 9) {
        f += int((n % pow(10, i)) / pow(10, i - 1))
    }

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:12:15: error: expected ';' before 'total'
   12 |    No = N/waru
      |               ^
      |               ;
   13 |     total += No;
      |     ~~~~~
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:15:5: error: 'else' without a previous 'if'
   15 |     else{
      |     ^~~~
a.cc:16:7: error: break statement not within loop or switch
   16 |       break;
      |       ^~~~~
a.cc: At global scope:
a.cc:19:3: error: expected unqualified-id before 'if'
   19 |   if(N % f == 0){
      |   ^~
a.cc:22:3: error: expected unqualified-id before 'else'
   22 |   else {
      |   ^~~~
a.cc:25:1: error: expected declaration before '}' token
   25 | }
      | ^
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:12:12: error: expected ';' before 'break'
   12 |       f = 1
      |            ^
      |            ;
   13 |       break;
      |       ~~~~~ 
a.cc:15:5: error: 'else' without a previous 'if'
   15 |     else{
      |     ^~~~
a.cc:16:7: error: break statement not within loop or switch
   16 |       break;
      |       ^~~~~
a.cc: At global scope:
a.cc:19:3: error: expected unqualified-id before 'if'
   19 |   if(N % f == 0){
      |   ^~
a.cc:22:3: error: expected unqualified-id before 'else'
   22 |   else {
      |   ^~~~
a.cc:25:1: error: expected declaration before '}' token
   25 | }
      | ^
Language: Java

import java.util.*;

class Main{
  public static void main(String[] args){
    try(Scanner sc = new Scanner(System.in)){
      String n = sc.next();
      int a = Integer.parseInt(n);
      int[]b = Integer.parseInt(n.split(""));
      int c = 0;
      for(int i = 0; i < b.length; i++){
        c = c + b[i];
      }
      if(a % c == 0){
        System.out.println("Yes");
      }else{
        System.out.println("No");
      }
    }
  }
}
      

Compiler output:
Main.java:8: error: incompatible types: String[] cannot be converted to String
      int[]b = Integer.parseInt(n.split(""));
                                       ^
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
1 error
Language: C++

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

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

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

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

int main(){
  int ans = 0;
  int N;
  cin >> N;
  for (int i = 0; i < (log10(N) / 1); i++) {
    ans += N[i];
  }
  if ((N % ans) == 0) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:13: error: invalid types 'int[int]' for array subscript
    9 |     ans += N[i];
      |             ^
Language: C++

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

int main(){
  int ans = 0;
  int N;
  cin >> N;
  for (int i = 1; i <= (log10(N) / 1); i++) {
    ans += N[i];
  }
  if ((N % ans) == 0) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:13: error: invalid types 'int[int]' for array subscript
    9 |     ans += N[i];
      |             ^
Language: C++

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

int main(){
  int ans = 0;
  int N;
  cin >> N;
  for (int i = 1; i <= (log10(N) / 1)) {
    string N;
    ans += N[i];
  }
  if ((N % ans) == 0) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:38: error: expected ';' before ')' token
    8 |   for (int i = 1; i <= (log10(N) / 1)) {
      |                                      ^
      |                                      ;
Language: C++

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

int main(){
  int ans = 0;
  int N;
  cin >> N;
  for (int i = 1; i <= (log10(N) / 1)) {
    ans += N[i];
  }
  if ((N % ans) == 0) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:38: error: expected ';' before ')' token
    8 |   for (int i = 1; i <= (log10(N) / 1)) {
      |                                      ^
      |                                      ;
a.cc:9:13: error: invalid types 'int[int]' for array subscript
    9 |     ans += N[i];
      |             ^
Language: C++

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

int main(){
  int ans = 0;
  int N;
  cin >> N;
  for (int i = 0; i < (log10(N) % 1)) {
    ans += N[i];
  }
  if ((N % ans) == 0) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:33: error: invalid operands of types '__gnu_cxx::__enable_if<true, double>::__type' {aka 'double'} and 'int' to binary 'operator%'
    8 |   for (int i = 0; i < (log10(N) % 1)) {
      |                        ~~~~~~~~ ^ ~
      |                             |     |
      |                             |     int
      |                             __gnu_cxx::__enable_if<true, double>::__type {aka double}
a.cc:8:37: error: expected ';' before ')' token
    8 |   for (int i = 0; i < (log10(N) % 1)) {
      |                                     ^
      |                                     ;
a.cc:9:13: error: invalid types 'int[int]' for array subscript
    9 |     ans += N[i];
      |             ^
Language: C++

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

int main(){
  int ans = 0;
  int N;
  cin >> N;
  for (int i = 0; i < (log10(N) % 1)) {
  ans += i;
  }
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:33: error: invalid operands of types '__gnu_cxx::__enable_if<true, double>::__type' {aka 'double'} and 'int' to binary 'operator%'
    8 |   for (int i = 0; i < (log10(N) % 1)) {
      |                        ~~~~~~~~ ^ ~
      |                             |     |
      |                             |     int
      |                             __gnu_cxx::__enable_if<true, double>::__type {aka double}
a.cc:8:37: error: expected ';' before ')' token
    8 |   for (int i = 0; i < (log10(N) % 1)) {
      |                                     ^
      |                                     ;
Language: C++

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

int main(){
  int ans;
  int N;
  cin >> N;
  for (int i = 0; i < log10(N))
  if(s[0]=='1') ans++;
  if(s[1]=='1') ans++;
  if(s[2]=='1') ans++;
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:31: error: expected ';' before ')' token
    8 |   for (int i = 0; i < log10(N))
      |                               ^
      |                               ;
a.cc:9:6: error: 's' was not declared in this scope
    9 |   if(s[0]=='1') ans++;
      |      ^
a.cc:10:6: error: 's' was not declared in this scope
   10 |   if(s[1]=='1') ans++;
      |      ^
a.cc:11:6: error: 's' was not declared in this scope
   11 |   if(s[2]=='1') ans++;
      |      ^
Language: C++

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

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

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:7: error: redeclaration of 'int s'
    8 |   int s=0;
      |       ^
a.cc:7:7: note: 'int s' previously declared here
    7 |   int s;
      |       ^
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:15: error: no match for 'operator/=' (operand types are 'std::basic_ostream<char>' and 'int')
   10 |     cout << N /=10;
      |     ~~~~~~~~~~^~~~
a.cc:11:13: error: expected ';' before '}' token
   11 |     s +=N%10
      |             ^
      |             ;
   12 |   }
      |   ~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:14: error: no match for 'operator/=' (operand types are 'std::basic_ostream<char>' and 'int')
   10 |     cout << N/=10%10;
      |     ~~~~~~~~~^~~~~~~
a.cc:11:10: error: expected ';' before '}' token
   11 |     s +=N
      |          ^
      |          ;
   12 |   }
      |   ~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:18: warning: division by zero [-Wdiv-by-zero]
   10 |     cout << s=s+N/=10%10;
      |               ~~~^~~~~~~
a.cc:10:16: error: lvalue required as left operand of assignment
   10 |     cout << s=s+N/=10%10;
      |               ~^~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:15: error: no match for 'operator+=' (operand types are 'std::basic_ostream<char>' and 'int')
   10 |     cout << s +=(N /=10)%10;
      |     ~~~~~~~~~~^~~~~~~~~~~~~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:29: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
   10 |     cout << s +=(N /=10)%10 << endl;
      |                 ~~~~~~~~~~~~^~~~~~~
a.cc:12:7: error: lvalue required as left operand of assignment
   12 |   if(N%s=0)
      |      ~^~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:6: error: expected ';' before 'for'
    8 |   s=0
      |      ^
      |      ;
    9 |   for(int i=0;i<8;i++){
      |   ~~~ 
a.cc:9:15: error: 'i' was not declared in this scope
    9 |   for(int i=0;i<8;i++){
      |               ^
a.cc:12:7: error: lvalue required as left operand of assignment
   12 |   if(N%s=0)
      |      ~^~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:4: error: 'f' cannot be used as a function
    8 |   f(N)=0
      |   ~^~~
a.cc:9:15: error: 'i' was not declared in this scope
    9 |   for(int i=0;i<8;i++){
      |               ^
a.cc:12:20: error: 'f' cannot be used as a function
   12 |   if(N/10==0 || N%f(N)==0)
      |                   ~^~~
Language: C++

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

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:15:17: error: invalid operands of types 'const char [3]' and '<unresolved overloaded function type>' to binary 'operator<<'
   15 |   else cout<"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=(stoll)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:14: error: cannot resolve overloaded function 'stoll' based on conversion to type 'll' {aka 'long long int'}
   45 |   ll a=(stoll)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;
      |            ^