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

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

int main(){
  string s;
  int sum,k;
  cin>>s;
  k = atoi(s.c_str());
  sum=0;
  
  for(int i=0;i<strlen(s);i++){
    sum += atoi(s[i]);
  }
  if(k%sum==0)
    cout<<"Yes"<<endl;
  else 
    cout<<"No"<<endl;
  return 0;
}
    
    
  
  

Compiler output:
a.cc: In function 'int main()':
a.cc:12:17: error: 'strlen' was not declared in this scope
   12 |   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<iostream>
  +++ |+#include <cstring>
    2 | #include<string>
a.cc:13:16: error: invalid conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const char*' [-fpermissive]
   13 |     sum += atoi(s[i]);
      |            ~~~~^~~~~~
      |                |
      |                __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char}
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/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 s;
  int sum,k;
  cin>>s;
  k = atoi(s);
  sum=0;
  
  for(int i=0;i<strlen(s);i++){
    sum += atoi(s[i]);
  }
  if(k%sum==0)
    cout<<"Yes"<<endl;
  else 
    cout<<"No"<<endl;
  return 0;
}
    
    
  
  

Compiler output:
a.cc: In function 'int main()':
a.cc:9:12: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
    9 |   k = atoi(s);
      |            ^
      |            |
      |            std::string {aka std::__cxx11::basic_string<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)
      |                  ~~~~~~~~~~~~^~~~~~
a.cc:12:17: error: 'strlen' was not declared in this scope
   12 |   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<iostream>
  +++ |+#include <cstring>
    2 | #include<string>
a.cc:13:16: error: invalid conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const char*' [-fpermissive]
   13 |     sum += atoi(s[i]);
      |            ~~~~^~~~~~
      |                |
      |                __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char}
/usr/include/stdlib.h:105:30: note:   initializing argument 1 of 'int atoi(const char*)'
  105 | extern int atoi (const char *__nptr)
      |                  ~~~~~~~~~~~~^~~~~~
Language: C++

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

int main() {
  string N;
  
  cin >> N;
  
  int m;
  m = std::stoi(100000000);
  
  cout << m << endl;
  
  vector<int> sum(N.size());
  vector<int> sum2(N.size());
  int ten;
  int goukei = 0;
  for (int i = 0; i < N.size(); i++){
    /*sum += N.at(i);*/
    ten = std::pow(10, i);
    sum[i] = m / ten;
    /*cout << ten << endl;*/
    /*cout << sum[i] << endl;*/
  }
  
  for (int i = 0; i < N.size(); i++){
    if (i !=  N.size() - 1){
      sum2[i] = sum[i] - sum[i + 1] * 10;
      /*cout << sum2[i] << endl;*/
    } else {
      sum2[i] = sum[i];
      /*cout << sum2[i] << endl;*/
    }
  }
  
  for (int i = 0; i < N.size(); i++){
    goukei += sum2[i];
  }
  
  if (m % goukei ==0){
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:16: error: no matching function for call to 'stoi(int)'
   10 |   m = std::stoi(100000000);
      |       ~~~~~~~~~^~~~~~~~~~~
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 'int' 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 'int' 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 a, p;
  a = N;
  p = 0;
  while (a > 0) {
    p += % 10;
      a /= 10
  if (a % p = 0) {
  cout << "Yes" << endl;
  else {
  cout << "No" << endl;
  }
  }
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:10:10: error: expected primary-expression before '%' token
   10 |     p += % 10;
      |          ^
a.cc:11:14: error: expected ';' before 'if'
   11 |       a /= 10
      |              ^
      |              ;
   12 |   if (a % p = 0) {
      |   ~~          
a.cc:18:4: error: expected '}' at end of input
   18 |   }
      |    ^
a.cc:3:12: note: to match this '{'
    3 | int main() {
      |            ^
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:20:18: error: expected ';' before '}' token
   20 |   else cout<<"No"
      |                  ^
      |                  ;
   21 | }
      | ~
Language: C++

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


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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:15:9: error: expected ';' before string constant
   15 |     cout"No"<<endl;
      |         ^~~~
      |         ;
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int num,dig;
  int sum = 0;
  cin >> num;
  while(num){
    dig = num % 10;
      sum = sum + dig;
    num = num / 10
  }
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:10:19: error: expected ';' before '}' token
   10 |     num = num / 10
      |                   ^
      |                   ;
   11 |   }
      |   ~
Language: Java

import java.util.Scanner;

public class A{
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    int N=scanner.nextInt();
    int ans=0;
    int nn=N;
    while(N>1){
      ans+=N%10;
      N/=10;
    }

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

  }
}


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

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:9:6: error: expected ';' before 'for'
    9 |   K=N
      |      ^
      |      ;
   10 | for(int i=0;i<1000000;i++){
      | ~~~   
a.cc:10:13: error: 'i' was not declared in this scope
   10 | for(int i=0;i<1000000;i++){
      |             ^
Language: C++

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

int main() {
	int N, f1, f2, f3, f4, f5, f6, f7, fn;
	cin >> N;
	f1 = N % 10;
	f2 = (N % 100 - f1) / 10;
	f3 = (N % 1000 - f1 - f2) / 100;
	f4 = (N % 10000 - f1 - f2 - f3) / 1000;
	f7 = N / 10000000;
	f6 = N / 1000000 - 10 * f7;
	f5 = N / 100000 - 10 * f6 - 100 * f7;
	fx = f1 + f2 + f3 + f4 + f5 + f6 + f7;
	if(N / fx === 0) {
		cout << "Yes" << endl;
	} else { 
		cout << "No" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:9: error: 'fx' was not declared in this scope; did you mean 'fn'?
   14 |         fx = f1 + f2 + f3 + f4 + f5 + f6 + f7;
      |         ^~
      |         fn
a.cc:15:21: error: expected primary-expression before '=' token
   15 |         if(N / fx === 0) {
      |                     ^
a.cc:19:2: error: expected '}' at end of input
   19 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

#include <iostream>
using namespace std;
int sumnum(int k){
  int b;
  while(n>0){
 b+= k%10;
    k=k/10;
}
  return b;
}
int main(){
  int d;
  cin >> d;
  if(d%sumnum(d)==0){
    cout << "Yes" << endl;
  } else{
    cout << "No" << endl;
  }
}

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

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

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

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

    string ans = "No";
    if (i % findSumOfDisits(i) == 0) {
        ans = "Yes";
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:9: error: 'i' was not declared in this scope
   18 |     if (i % findSumOfDisits(i) == 0) {
      |         ^
Language: C++

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

int main(){
  int N, t, s, u, i, n;
  cin >> N;
  t = 0;
  s = 10;
  u = 0;
  i = 0;
  n = N;
    
  while(i < N){
    if(N / s == 0){
      u += 1
      break;
    }
    else{
      s *= 10;
      u += 1;
    }
    i++;
  }
  for(int l = 0; l < u; l++){
    t += n % 10;
    n = n / 10;
  }
  if(N % t == 0){
    cout << "Yes" << endl;
  }
  else{
    cout << "No" << endl;
  }
}



Compiler output:
a.cc: In function 'int main()':
a.cc:15:13: error: expected ';' before 'break'
   15 |       u += 1
      |             ^
      |             ;
   16 |       break;
      |       ~~~~~
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:10:14: error: expected ';' before 'X'
   10 |     y += X%10
      |              ^
      |              ;
   11 |     X /=10
      |     ~
Language: C++

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

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


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

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:10:8: error: expected ';' before 'c'
   10 |   t/=10
      |        ^
      |        ;
   11 |   c=t%10
      |   ~     
a.cc:18:2: error: expected '}' at end of input
   18 | }
      |  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

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

int main(){
  string s;cin>>s;
  int num=stoi(s);
  int sum=0;
  for(int i=0;i<s.size();i++){
    sum+=s.at(i).to_i;
  }
  cout << (num%sum==0? "Yes" : "No") << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:18: error: request for member 'to_i' in 's.std::__cxx11::basic_string<char>::at(((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'}
   10 |     sum+=s.at(i).to_i;
      |                  ^~~~
Language: C++

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

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

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

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

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
    6 |   cin >>N;
      |   ^~~
a.cc:18:9: error: 'cout' was not declared in this scope
   18 |         cout << "Yes" << endl;
      |         ^~~~
a.cc:18:26: error: 'endl' was not declared in this scope
   18 |         cout << "Yes" << endl;
      |                          ^~~~
a.cc:21:9: error: 'cout' was not declared in this scope
   21 |         cout << "No" << endl;
      |         ^~~~
a.cc:21:25: error: 'endl' was not declared in this scope
   21 |         cout << "No" << endl;
      |                         ^~~~
Language: C++

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

int main(){
  int N;
  cin >> N;
  
  int fn = 0;
  
  for(int i=1;i<N){
    int x = N % i;
    int y = x % i*10;
    fn += y;
  }
  
  if(N % fn == 0){
  cout << "Yes" << endl;
  }
  if(N % fn != 0){
  cout << "No" << endl;
  }
  
}



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

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

int main(){
  int N;
  cin >> N;
  
  int fn = 0;
  
  fot(int i=1;i<N;){
    int x = N % i;
    int y = x % i*10;
    fn += y;
  }
  
  if(N % fn == 0){
  cout << "Yes" << endl;
  }
  if(N % fn != 0){
  cout << "No" << endl;
  }
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:7: error: expected primary-expression before 'int'
   10 |   fot(int i=1;i<N;){
      |       ^~~
a.cc:10:15: error: 'i' was not declared in this scope
   10 |   fot(int i=1;i<N;){
      |               ^
a.cc:10:19: error: expected primary-expression before ')' token
   10 |   fot(int i=1;i<N;){
      |                   ^
Language: C++

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

int main(){
  int N;
  cin >> N;
  
  int f(N) = 0;
  
  fot(int i=1; i<N;){
    int x = N % i;
    int y = x % i*10;
    f(N) += y;
  }
  
  if(N % f(N) == 0){
  cout << "Yes" << endl;
  }
  if(N % f(N) != 0){
  cout << "No" << endl;
  }
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:12: error: expected ',' or ';' before '=' token
    8 |   int f(N) = 0;
      |            ^
a.cc:10:7: error: expected primary-expression before 'int'
   10 |   fot(int i=1; i<N;){
      |       ^~~
a.cc:10:16: error: 'i' was not declared in this scope
   10 |   fot(int i=1; i<N;){
      |                ^
a.cc:10:20: error: expected primary-expression before ')' token
   10 |   fot(int i=1; i<N;){
      |                    ^
a.cc:16:11: error: 'f' cannot be used as a function
   16 |   if(N % f(N) == 0){
      |          ~^~~
a.cc:19:11: error: 'f' cannot be used as a function
   19 |   if(N % f(N) != 0){
      |          ~^~~
Language: C++

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

int main() {
  
  int N;
  cin >> N;
  int count =0;
  
  for (int i=1; N%i > 0 ; i*10 ){
  int a = N.at(i);
  count +=a;
  }
  
  if(N % count ==0){
  cout << "Yes" << endl;
  }
  if(N % count != 0){
  cout << "No" << endl;
  }
}

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

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

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

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

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

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

#include <iostream>
using namespace std;
 
int Digitsum(int n) {
  int sum = 0;
  while (n > 0) {
    sum += n % 10;
    n /= 10;
  }
  return sum;
}
 
int main( ) {
 int N;
cin>>N;
int amari= int N % int Digitsum( int N);
if( amari=0){
return Yes;
}
else{
return No;
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:12: error: expected primary-expression before 'int'
   16 | int amari= int N % int Digitsum( int N);
      |            ^~~
a.cc:18:8: error: 'Yes' was not declared in this scope
   18 | return Yes;
      |        ^~~
a.cc:21:8: error: 'No' was not declared in this scope; did you mean 'N'?
   21 | return No;
      |        ^~
      |        N
Language: C++

#include <iostream>
using namespace std;
 
int Digitsum(int n) {
  int sum = 0;
  while (n > 0) {
    sum += n % 10;
    n /= 10;
  }
  return sum;
}
 
int main( ) {
 int N;
cin>>N;
int amari=N%Digitsum(N);
if( amari=0){
return Yes;
}
else{
return No;
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:8: error: 'Yes' was not declared in this scope
   18 | return Yes;
      |        ^~~
a.cc:21:8: error: 'No' was not declared in this scope; did you mean 'N'?
   21 | return No;
      |        ^~
      |        N
Language: C++

#include <iostream>
using namespace std;

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

int main( ) {
 int N;
cin>>N;
int amari=N/Digitsum(N);
if( amari=0){
return Yes;
}
else{
return No;
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:8: error: 'Yes' was not declared in this scope
   18 | return Yes;
      |        ^~~
a.cc:21:8: error: 'No' was not declared in this scope; did you mean 'N'?
   21 | return No;
      |        ^~
      |        N
Language: C++

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

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

  int d = n.length();
  int f = 0;
  for (int i = 0; i < d; i++) {
      int m = stoi({n[i]});
      f += m;
  }
  
  if (stoi(n) % f == 0) cout << "Yes" << endl;
  else cout << "No" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:19: error: call of overloaded 'stoi(<brace-enclosed initializer list>)' is ambiguous
   11 |       int m = 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: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)
      |   ^~~~
Language: C++

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

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

  int d = n.length();
  int f = 0;
  for (int i = 0; i < d; i++) {
      int m = stoi({k[i]});
      f += m;
  }
  
  if (stoi(n) % f == 0) cout << "Yes" << endl;
  else cout << "No" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:21: error: 'k' was not declared in this scope
   11 |       int m = stoi({k[i]});
      |                     ^
a.cc:11:19: error: no matching function for call to 'stoi(<brace-enclosed initializer list>)'
   11 |       int m = stoi({k[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 '<brace-enclosed initializer list>' 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 '<brace-enclosed initializer list>' 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 d = n.length();
  int f = 0;
  for (int i = 0; i < d; i++) {
      string k = n[i]s;
      int m = stoi(k);
      f += m;
  }
  
  if (stoi(n) % f == 0) cout << "Yes" << endl;
  else cout << "No" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:21: error: conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
   11 |       string k = n[i]s;
      |                     ^
a.cc:11:22: error: expected ',' or ';' before 's'
   11 |       string k = n[i]s;
      |                      ^
Language: C++

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

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

  int d = n.length();
  int f = 0;
  for (int i = 0; i < d; i++) {
      string k = n[i];
      int m = stoi(k);
      f += m;
  }
  
  if (stoi(n) % f == 0) cout << "Yes" << endl;
  else cout << "No" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:21: error: conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
   11 |       string k = n[i];
      |                     ^
Language: C++

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

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

  int d = n.length();
  int f = 0;
  for (int i = 0; i < d; i++) {
      int m = stoi(n[i].c_str());
      f += m;
  }
  
  if (stoi(n) % f == 0) cout << "Yes" << endl;
  else cout << "No" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:25: error: request for member 'c_str' in 'n.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'}
   11 |       int m = stoi(n[i].c_str());
      |                         ^~~~~
Language: C++

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

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

  int d = n.length();
  int f = 0;
  for (int i = 0; i < d; i++) {
      int m = stoi(n[i].c_str());
      f += m
  }
  
  if (stoi(n) % f == 0) cout << "Yes" << endl;
  else cout << "No" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:25: error: request for member 'c_str' in 'n.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'}
   11 |       int m = stoi(n[i].c_str());
      |                         ^~~~~
a.cc:12:13: error: expected ';' before '}' token
   12 |       f += m
      |             ^
      |             ;
   13 |   }
      |   ~
Language: C++

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

int main() {
  string m, n;
  cin >> n;

  int d = n.length();
  int f = 0;
  for (int i = 0; i < d; i++) {
      m = stoi(n[i]);
      f += m
  }
  
  if (stoi(n) % f == 0) cout << "Yes" << endl;
  else cout << "No" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:15: error: no matching function for call to 'stoi(__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type&)'
   11 |       m = 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)
      |        ~~~~~~~~~~~~~~~^~~~~
a.cc:12:9: error: no match for 'operator+=' (operand types are 'int' and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
   12 |       f += m
      |       ~~^~~~
Language: C++

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

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

  int d = n.length();
  int f = 0;
  for (int i = 0; i < d; i++) {
      m = stoi(n[i]);
      f += m
  }
  
  if (stoi(n) % f == 0) cout << "Yes" << endl;
  else cout << "No" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:7: error: 'm' was not declared in this scope
   11 |       m = stoi(n[i]);
      |       ^
a.cc:11:15: error: no matching function for call to 'stoi(__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type&)'
   11 |       m = 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, d, p;
  int sum = 0;
  cin >> n;

  m = n;
  while ((m /= 10) != 0) d++;

  for (int i = d; i >= 0; i--) {
      p = pow(10,i);
      sum += n / p;
      n %= p
  }

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: 'm' was not declared in this scope
    9 |   m = n;
      |   ^
a.cc:15:13: error: expected ';' before '}' token
   15 |       n %= p
      |             ^
      |             ;
   16 |   }
      |   ~
Language: C++

#include <iostream>
using namespace std;
int main(){
  int i,sum=0,n,;
  cin>>n;
  for(i=100000000;i>0;i/=10){
    sum+=n/i;
  }
  if(n%sum==0) cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:17: error: expected unqualified-id before ';' token
    4 |   int i,sum=0,n,;
      |                 ^
Language: C++

#iclude <iostream>
using namespace std;
int main(){
  int i,sum=0,n;
  cin>>n;
  for(i=10;i<n;i*=10){
    sum+=n%i;
  }
  if(n%sum==0) cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
  return 0;
}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #iclude; did you mean #include?
    1 | #iclude <iostream>
      |  ^~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   cin>>n;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #iclude <iostream>
a.cc:9:16: error: 'cout' was not declared in this scope
    9 |   if(n%sum==0) cout<<"Yes"<<endl;
      |                ^~~~
a.cc:9:16: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:9:29: error: 'endl' was not declared in this scope
    9 |   if(n%sum==0) cout<<"Yes"<<endl;
      |                             ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #iclude <iostream>
a.cc:10:8: error: 'cout' was not declared in this scope
   10 |   else cout<<"No"<<endl;
      |        ^~~~
a.cc:10:8: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:10:20: error: 'endl' was not declared in this scope
   10 |   else cout<<"No"<<endl;
      |                    ^~~~
a.cc:10:20: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: 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 sum = 0;
  while(true) {
    if ( N < 10 )　break;
    sum += N % 10;
    N /= 10;
  }
  
  cout << sum << endl;
}


Compiler output:
a.cc:10:18: error: extended character 　 is not valid in an identifier
   10 |     if ( N < 10 )　break;
      |                  ^
a.cc: In function 'int main()':
a.cc:10:18: error: '\U00003000break' was not declared in this scope
   10 |     if ( N < 10 )　break;
      |                  ^~~~~~~
Language: C++

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

int main() {
  int N;
  cin >> N;
  
  int sum = 0;
  for( ; ; ) {
    if ( N < 10 )　break;
    sum += N % 10;
    N /= 10;
  }
  
  cout << sum << endl;
}


Compiler output:
a.cc:10:18: error: extended character 　 is not valid in an identifier
   10 |     if ( N < 10 )　break;
      |                  ^
a.cc: In function 'int main()':
a.cc:10:18: error: '\U00003000break' was not declared in this scope
   10 |     if ( N < 10 )　break;
      |                  ^~~~~~~
Language: C++

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

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


Compiler output:
a.cc:10:18: error: extended character 　 is not valid in an identifier
   10 |     if ( n < 10 )　break;
      |                  ^
a.cc: In function 'int main()':
a.cc:10:10: error: 'n' was not declared in this scope
   10 |     if ( n < 10 )　break;
      |          ^
a.cc:10:18: error: '\U00003000break' was not declared in this scope
   10 |     if ( n < 10 )　break;
      |                  ^~~~~~~
Language: C++

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

int main() {

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


Compiler output:
a.cc: In function 'int main()':
a.cc:7:4: error: expected initializer before 'int'
    7 |    int x;
      |    ^~~
a.cc:8:9: error: 'N' was not declared in this scope
    8 |   int M=N
      |         ^
a.cc:16:5: error: 'x' was not declared in this scope
   16 |     x=M%10;
      |     ^
Language: C++

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

int main() {

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


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

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

int main() {

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


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

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

int main() {

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


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

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

int main() {
  int N, x, n;
  cin >> N;
  x = 0;
  for (int i = 8; i >= 0; i--) {
    int a, p;
    p = 1;
    for (int j = 0; j < i; j++) {
      P *= 10;
    }
    a = N / p;
    n = N - p * a;
    x = += a;
  }
  if (N % x == 0) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:7: error: 'P' was not declared in this scope
   12 |       P *= 10;
      |       ^
a.cc:16:9: error: expected primary-expression before '+=' token
   16 |     x = += a;
      |         ^~
Language: C++

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

int sumsum(int n) {
  while(n>0){
    int sum =0;
    sum += n % 10;
    n /= 10;
  }
  return sum;
}
int main(){
  int N;
  cin>>N;
  string ans = "No";
  if(N % sumsum(N) == 0){
    ans ="Yes";
  }
  
}

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

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

int sumsum(int n) {
  while(n>0){
    int sum =0;
    sum += n % 10;
    n /= 10
  }
  return sum;
}
int main(){
  int N;
  cin>>N;
  string ans = "No";
  if(N % sumsum(N) == 0){
    ans ="Yes";
  }
  
}

Compiler output:
a.cc: In function 'int sumsum(int)':
a.cc:9:12: error: expected ';' before '}' token
    9 |     n /= 10
      |            ^
      |            ;
   10 |   }
      |   ~         
a.cc:11:10: error: 'sum' was not declared in this scope
   11 |   return sum;
      |          ^~~
Language: C++

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

int main(){
  
  string S;
  int x,y,z;
  cin >> S;
  z = (int) S;
  int N = S.size()
    
  for (int i = 0; i < N; i++){
    x = (int) S.at(i);
    y += x;
  }
  
  if (z % y == 0){
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
  
}
    
  
  

Compiler output:
a.cc: In function 'int main()':
a.cc:9:7: error: invalid cast from type 'std::string' {aka 'std::__cxx11::basic_string<char>'} to type 'int'
    9 |   z = (int) S;
      |       ^~~~~~~
a.cc:12:3: error: expected ',' or ';' before 'for'
   12 |   for (int i = 0; i < N; i++){
      |   ^~~
a.cc:12:19: error: 'i' was not declared in this scope
   12 |   for (int i = 0; i < N; i++){
      |                   ^
Language: C++

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

int main(){
  
  string S;
  int x,y,z;
  cin >> S;
  z = (int) S;
  int N = S.size()
    
  for (int i = 0; i < N; i++){
    x = (int) S.at(i);
    y += x;
  }
  
  if (z % y == 0){
    cout << "Yes" << endl;
  }
  else if {
    cout << "No" << endl;
  }
  
}
    
  
  

Compiler output:
a.cc: In function 'int main()':
a.cc:9:7: error: invalid cast from type 'std::string' {aka 'std::__cxx11::basic_string<char>'} to type 'int'
    9 |   z = (int) S;
      |       ^~~~~~~
a.cc:12:3: error: expected ',' or ';' before 'for'
   12 |   for (int i = 0; i < N; i++){
      |   ^~~
a.cc:12:19: error: 'i' was not declared in this scope
   12 |   for (int i = 0; i < N; i++){
      |                   ^
a.cc:20:11: error: expected '(' before '{' token
   20 |   else if {
      |           ^
      |           (
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:28:10: error: expected '(' before '{' token
   28 |   else if{
      |          ^
      |          (
a.cc:30:2: error: expected '}' at end of input
   30 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

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

Compiler output:
a.cc:10:12: error: exponent has no digits
   10 |     if(int(1e(i))<=N<int(1e(i+1))-1){
      |            ^~
a.cc:10:26: error: exponent has no digits
   10 |     if(int(1e(i))<=N<int(1e(i+1))-1){
      |                          ^~
a.cc:17:16: error: exponent has no digits
   17 |     s+=((N/int(1e(i)))%int(1e(i+1));
      |                ^~
a.cc:17:28: error: exponent has no digits
   17 |     s+=((N/int(1e(i)))%int(1e(i+1));
      |                            ^~
a.cc: In function 'int main()':
a.cc:17:36: error: expected ')' before ';' token
   17 |     s+=((N/int(1e(i)))%int(1e(i+1));
      |        ~                           ^
      |                                    )
Language: C++

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

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

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

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

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


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

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:15:8: error: 'x' was not declared in this scope
   15 |   if(N%x==0)
      |        ^
Language: C++

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

int main(){
  int N;
  cin >>N;
  int x=0, y=10;
  for(int i=0; i<9; i++){
    else if(N<y)
      break;
    x+=N/y;
    y*=10;
  }
  if((N%x==0&&x!=0)||x=0)
    cout <<"Yes" <<endl;
  else
    cout <<"No" <<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: 'else' without a previous 'if'
    9 |     else if(N<y)
      |     ^~~~
a.cc:14:20: error: lvalue required as left operand of assignment
   14 |   if((N%x==0&&x!=0)||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<9; i++){
    if(N<10**i)
      break;
    x+=N/(10**i);
  }
  if(N==x)
    cout <<"Yes" <<endl;
  else
    cout <<"No" <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:13: error: invalid type argument of unary '*' (have 'int')
    9 |     if(N<10**i)
      |             ^~
a.cc:11:14: error: invalid type argument of unary '*' (have 'int')
   11 |     x+=N/(10**i);
      |              ^~
Language: C++

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

int main() {
  int n;
  int f=0;
  cin >> n;
  for(int x=1000000000; x!=1; e=e/10){
    f += n%x/(x/10);
  }
  if(n%f==0)cout << "Yes" << endl;
  else cout << "No" << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:31: error: 'e' was not declared in this scope
    8 |   for(int x=1000000000; x!=1; e=e/10){
      |                               ^
Language: C++

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

int main() {
  int n;
  int f=0;
  cin >> n;
  for(int x=1000000000; x!=1; e=e/10){
    f += n%x/(x/10)
  }
  if(n%f==0)cout << "Yes" << endl;
  else cout << "No" << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:31: error: 'e' was not declared in this scope
    8 |   for(int x=1000000000; x!=1; e=e/10){
      |                               ^
a.cc:9:20: error: expected ';' before '}' token
    9 |     f += n%x/(x/10)
      |                    ^
      |                    ;
   10 |   }
      |   ~
Language: C++

#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <bitset>
#include <deque>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>
#include <iterator>
#include <string>
#include <cctype>
#include <stdio.h>
using namespace std;

int main() {
    double x;cin>>x;
    double y = x;
    y = to_string(y).length();
    double res = 0;
    for (int i = 0;i<y;i++){
        double tmp = x;
        tmp = x/pow(10,i);
        res = res + tmp;
    }
    if (x%res==0){
        puts("Yes");
    } else {
        puts("No");
    }
}


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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:8:12: error: expected ';' before 'M'
    8 |     a=N/ten
      |            ^
      |            ;
    9 |     M+=(a%10);
      |     ~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:12: error: expected ';' before 'M'
    8 |     a=N/ten
      |            ^
      |            ;
    9 |     M+=(a%10)
      |     ~