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

#include <iostream>

using namespace std;

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


Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

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

int main(){
	int b,sum=0;
	// int x;
	scanf("%d",&b);
	a=b;
	printf("%d",a);
	for(int i=0;;i++){
		if(a>0){
			sum=sum+(a%10);
			a=a/10;
			//printf("%d",a);
			//printf("%d",sum);
			}
		else ibreak;	
		}
	//printf("%lld\n",sum);
	if(b%sum==0) printf("Yes\n");
	else printf("No\n");
	return 0;
	}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'a' was not declared in this scope
    8 |         a=b;
      |         ^
a.cc:17:22: error: 'ibreak' was not declared in this scope
   17 |                 else ibreak;
      |                      ^~~~~~
Language: C++

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

int main(){
	int b,sum=0;
	// int x;
	scanf("%d",&b);
	a=b;
	printf("%d",a);
	for(int i=0;;i++){
		if(a>0){
			sum=sum+(a%10);
			a=a/10;
			//printf("%d",a);
			//printf("%d",sum);
			}
		else if(a<0)break;	
		}
	//printf("%lld\n",sum);
	if(b%sum==0) printf("Yes\n");
	else printf("No\n");
	return 0;
	}


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

#include<stdio.h>
#include<string.h>
#include<math.h>
int main (){
	char str[11];
	long long int a=0,b,i,c=0,f;
	scanf("%s",str);
	b=strlen(str);
	for(i=0;i<b;i++){
		a=a+(str[i]-'0');
		f=pow(10,b-i-1)
		c=c+((str[i]-'0')*f);	
	}
	if(c%b==0){
		printf("Yes\n");
		}
	else printf("No\n");
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:11:32: error: expected ';' before 'c'
   11 |                 f=pow(10,b-i-1)
      |                                ^
      |                                ;
   12 |                 c=c+((str[i]-'0')*f);
      |                 ~
Language: C

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

int sum(int a)

int main()

{
    
    long long a;
    scanf("%lld",&a);
    int s= sum(a);
    if(a%s==0)
        printf("YES");
    else
        printf("NO");
    
    return 0;
}

int sum(int a)
{
   int n, t, sum = 0, remainder;

   printf("Enter an integer\n");
   scanf("%d", &n);

   t = n;

   while (t != 0)
   {
      remainder = t % 10;
      sum       = sum + remainder;
      t         = t / 10;
   }

   //printf("Sum of digits of %d = %d\n", n, sum);

   return sum;
}



Compiler output:
main.c: In function 'sum':
main.c:8:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
    8 | {
      | ^
main.c:22:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
   22 | {
      | ^
main.c:42: error: expected '{' at end of input
Language: C

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

int sum(int a)

int main()

{
    
    long long a;
    scanf("%lld",&a);
    int s= sum(a);
    if(a%s==0)
        printf("YES");
    else
        printf("NO");
    
    return 0;
}

int sum(int a)
{
   int n, t, sum = 0, remainder;

   printf("Enter an integer\n");
   scanf("%d", &n);

   t = n;

   while (t != 0)
   {
      remainder = t % 10;
      sum       = sum + remainder;
      t         = t / 10;
   }

   //printf("Sum of digits of %d = %d\n", n, sum);

   return sum;
}



Compiler output:
main.c:1:18: error: missing terminating > character
    1 | #include<stdio.h.
      |                  ^
main.c:1:9: fatal error: stdio.h.: No such file or directory
    1 | #include<stdio.h.
      |         ^
compilation terminated.
Language: C++

#include <iostream>
using namespace std;

int func(int x){
  if(x<10) return x;
  return x%10+func(x/10)
}

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

Compiler output:
a.cc: In function 'int func(int)':
a.cc:6:25: error: expected ';' before '}' token
    6 |   return x%10+func(x/10)
      |                         ^
      |                         ;
    7 | }
      | ~
Language: Java

import java.util.*;

public class Main {
 public static void main(String args[]) {
   Scanner sc = new Scanner(System.in);
   int n = sc.nextInt();
   char[] n = String.valueOf(n).toCharArray();
   int sn = 0;
   for (int i = 0; i < n.length; i++) {
     sn += Integer.parseInt(char[i]);
   }
   if(n % sn == 0) {
      System.out.println("Yes");
      return;
   } 
   System.out.println("No");
 }
}

Compiler output:
Main.java:10: error: ']' expected
     sn += Integer.parseInt(char[i]);
                                 ^
Main.java:10: error: ';' expected
     sn += Integer.parseInt(char[i]);
                                  ^
2 errors
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define Would
#define you
#define please
int main() {
	int N;
	cin >> N;

	int S[10] = {};
	int i = 0;
	int N0 = N;
	while (N) {
		S[i] = N % 10;
		N /= 10;
		i++;
	}
	int goukei = 0;
	rep(i, 10) goukei += S[i];
	if (N0 / goukei == 0) cout << "Yes" << endl;
	else cout << "No" << endl;
	Sleep(30000);

	Would you please return 0;
}

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

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


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

#include<stdio.h>
#include<string.h>
#include<math.h>
int main()
{
	int i,sum=0,n=0,ans=0,len;
	char s[11];
	for(i=1;i<=10;i++){
		scanf("%s",&s[i]);
	}
	len = strlen(s);
	for(i=1;i<=len;i++){
		for(j=0;j<=9;j++){
			if(s[i]=='j')n+=j*(pow(10,(len-i+1)));
			sum += j;
		}
	}
	printf(n%sum==0?"Yes":"No");
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:13:21: error: 'j' undeclared (first use in this function)
   13 |                 for(j=0;j<=9;j++){
      |                     ^
main.c:13:21: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
#include<string,h>
#include<math.h>
int main()
{
	int i,sum=0,n=0,ans=0,len;
	char s[11];
	for(i=1;i<=10;i++){
		scanf("%s",&s[i]);
	}
	len = strlen(s);
	for(i=1;i<=len;i++){
		for(j=0;j<=9;j++){
			if(s[i]=='j')n+=j*(pow(10,(len-i+1)));
			sum += j;
		}
	}
	printf(n%sum==0?"Yes":"No");
	return 0;
}


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

#include <iostream>

using namespace std;

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


}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:16: error: expected ';' before ')' token
   13 |         for(tmp){
      |                ^
      |                ;
a.cc:18:3: error: expected primary-expression before 'if'
   18 |   if(n%s)cout <<"No" << endl;
      |   ^~
a.cc:16:6: error: expected ';' before 'if'
   16 |     }
      |      ^
      |      ;
   17 | 
   18 |   if(n%s)cout <<"No" << endl;
      |   ~~  
a.cc:18:3: error: expected primary-expression before 'if'
   18 |   if(n%s)cout <<"No" << endl;
      |   ^~
a.cc:16:6: error: expected ')' before 'if'
   16 |     }
      |      ^
      |      )
   17 | 
   18 |   if(n%s)cout <<"No" << endl;
      |   ~~  
a.cc:13:12: note: to match this '('
   13 |         for(tmp){
      |            ^
Language: C++

#include <iostream>

using namespace std;

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


}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:16: error: expected ';' before ')' token
   11 |         for(tmp){
      |                ^
      |                ;
a.cc:16:3: error: expected primary-expression before 'if'
   16 |   if(n%s)cout <<"No" << endl;
      |   ^~
a.cc:14:6: error: expected ';' before 'if'
   14 |     }
      |      ^
      |      ;
   15 | 
   16 |   if(n%s)cout <<"No" << endl;
      |   ~~  
a.cc:16:3: error: expected primary-expression before 'if'
   16 |   if(n%s)cout <<"No" << endl;
      |   ^~
a.cc:14:6: error: expected ')' before 'if'
   14 |     }
      |      ^
      |      )
   15 | 
   16 |   if(n%s)cout <<"No" << endl;
      |   ~~  
a.cc:11:12: note: to match this '('
   11 |         for(tmp){
      |            ^
Language: C++

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

    while(N){
        sum+=N%10;
        N=N/10;
    }

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

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:5: error: 'cin' was not declared in this scope
    3 |     cin>>N;
      |     ^~~
a.cc:11:17: error: 'cout' was not declared in this scope
   11 |     if(N%sum==0)cout<<"Yes"<<endl;
      |                 ^~~~
a.cc:11:30: error: 'endl' was not declared in this scope
   11 |     if(N%sum==0)cout<<"Yes"<<endl;
      |                              ^~~~
a.cc:12:10: error: 'cout' was not declared in this scope
   12 |     else cout<<"No"<<endl;
      |          ^~~~
a.cc:12:22: error: 'endl' was not declared in this scope
   12 |     else cout<<"No"<<endl;
      |                      ^~~~
Language: C++

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

Compiler output:
a.cc: In function 'void sumofdigits(int)':
a.cc:9:10: error: return-statement with a value, in function returning 'void' [-fpermissive]
    9 |   return sum;
      |          ^~~
a.cc: In function 'int main()':
a.cc:14:24: error: void value not ignored as it ought to be
   14 |     int s = sumofdigits(n);
      |             ~~~~~~~~~~~^~~
Language: C++

# coding: utf-8
# Your code here!

s=input()
if int(s)%sum(map(int,list(s)))==0:
    print("Yes")
else:
    print("No")

Compiler output:
a.cc:1:3: error: invalid preprocessing directive #coding
    1 | # coding: utf-8
      |   ^~~~~~
a.cc:2:3: error: invalid preprocessing directive #Your
    2 | # Your code here!
      |   ^~~~
a.cc:4:1: error: 's' does not name a type
    4 | s=input()
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
    ll N;
    cin >> N;
    string s = to_string(N);
    ll sn = 0;
    for(char c : s) sn += c - '0';
    cout << (N % sn ? "No" : "Yes") << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:4:5: error: 'll' was not declared in this scope
    4 |     ll N;
      |     ^~
a.cc:5:12: error: 'N' was not declared in this scope
    5 |     cin >> N;
      |            ^
a.cc:7:7: error: expected ';' before 'sn'
    7 |     ll sn = 0;
      |       ^~~
      |       ;
a.cc:8:21: error: 'sn' was not declared in this scope; did you mean 's'?
    8 |     for(char c : s) sn += c - '0';
      |                     ^~
      |                     s
a.cc:9:18: error: 'sn' was not declared in this scope; did you mean 's'?
    9 |     cout << (N % sn ? "No" : "Yes") << endl;
      |                  ^~
      |                  s
Language: C++

/*************************************************************************
	> File Name: P4159.cpp
	> Author: 
	> Mail: 
	> Created Time: 2018年08月05日 星期日 13时49分39秒
 ************************************************************************/

#include<iostream>
using namespace std;
int sum(long long n) {
    while (n) {
        sum += n % 10;
        n /= 10;
    }
    return sum;
}
int main() {
    int n;
    cin >> n;
    if (n % sum(n) == 0) {
        cout << "YES" << endl;
    } else {
        cout << "NO" << endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int sum(long long int)':
a.cc:12:13: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   12 |         sum += n % 10;
      |         ~~~~^~~~~~~~~
a.cc:12:13: error: assignment of read-only location 'sum'
a.cc:15:12: error: invalid conversion from 'int (*)(long long int)' to 'int' [-fpermissive]
   15 |     return sum;
      |            ^~~
      |            |
      |            int (*)(long long int)
Language: C++

z#include <iostream>

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

Compiler output:
a.cc:1:2: error: stray '#' in program
    1 | z#include <iostream>
      |  ^
a.cc:1:1: error: 'z' does not name a type
    1 | z#include <iostream>
      | ^
a.cc: In function 'int main()':
a.cc:6:5: error: 'string' was not declared in this scope
    6 |     string s;
      |     ^~~~~~
a.cc:7:5: error: 'cin' was not declared in this scope
    7 |     cin >> a;
      |     ^~~
a.cc:8:5: error: 's' was not declared in this scope
    8 |     s = to_string(a);
      |     ^
a.cc:8:9: error: 'to_string' was not declared in this scope
    8 |     s = to_string(a);
      |         ^~~~~~~~~
a.cc:14:9: error: 'cout' was not declared in this scope
   14 |         cout << "Yes" << endl;
      |         ^~~~
a.cc:14:26: error: 'endl' was not declared in this scope
   14 |         cout << "Yes" << endl;
      |                          ^~~~
a.cc:16:9: error: 'cout' was not declared in this scope
   16 |         cout << "No" << endl;
      |         ^~~~
a.cc:16:25: error: 'endl' was not declared in this scope
   16 |         cout << "No" << endl;
      |                         ^~~~
Language: C++

#include <stdio.h>

int DigitSum(int N){
    int digit,sum;
    do{
        digit = N % 10;
        N -=  digit;
        N /= 10;
        sum += digit;
    }while(N==0);
    return sum;
}

int main(int argc, char * argv[]){
    long int N = atoi(argv[1]);
    if(N % DigitSum(N)==0){
        printf("Yes");
    } else {
        printf("No");
    }   
    return 0;
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:15:18: error: 'atoi' was not declared in this scope
   15 |     long int N = atoi(argv[1]);
      |                  ^~~~
Language: C++

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

int main(void) {
  int N;
  cin >> N;
  int S = N % 10;
  int t = 1;
  for(int i = 1; i <= 9) {
    t *= 10;
    S += N / t - N / (t * 10) * 10;
  }
  if(N % S == 0) cout << "Yes" << endl;
  else cout << "No" << endl;
}

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

#include<bits/stdc++.h>
using ll  = long long;
#define int ll
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,s,n) for(int i=s;i<n;i++)
#define all(in) in.begin(), in.end()
#define MP make_pair
#define INF (sizeof(int) == 4 ? 1e9:1e18)
#define EPS 0.0000000001
using namespace std;
template<class T, class S> void cmin(T &a, const S &b) { if (a > b)a = b; }
template<class T, class S> void cmax(T &a, const S &b) { if (a < b)a = b; }
template<typename Head, typename Value> auto vectors(const Head &head, const Value &v) { return vector<Value>(head, v); }
template<typename Head, typename... Tail> auto vectors(Head x, Tail... tail) { auto inner = vectors(tail...); return vector<decltype(inner)>(x, inner); }
template<class T> void join(T a){for(auto itr :a){if(itr != *a.begin())cout << " "; cout << itr;} }
using ld  = long double;
using pii = pair<int,int>;
using piii = pair<int,pii>;
int W,H;
int dx[]={0,0,1,-1}, dy[]={1,-1,0,0};
bool valid(int x,int y){return (0<=x&&x<W)&&(0<=y&&y<H);}
signed main(){
    string s; cin >> s;
    int res = 0; rep(i,s.size())res += s[i] - '0';
    cout << (stoll(s)%res "Yes":"No") << endl;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:25:26: error: expected ')' before string constant
   25 |     cout << (stoll(s)%res "Yes":"No") << endl;
      |             ~            ^~~~~~
      |                          )
Language: C++

#include<bits/stdc++.h>
using ll  = long long;
#define int ll
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,s,n) for(int i=s;i<n;i++)
#define all(in) in.begin(), in.end()
#define MP make_pair
#define INF (sizeof(int) == 4 ? 1e9:1e18)
#define EPS 0.0000000001
using namespace std;
template<class T, class S> void cmin(T &a, const S &b) { if (a > b)a = b; }
template<class T, class S> void cmax(T &a, const S &b) { if (a < b)a = b; }
template<typename Head, typename Value> auto vectors(const Head &head, const Value &v) { return vector<Value>(head, v); }
template<typename Head, typename... Tail> auto vectors(Head x, Tail... tail) { auto inner = vectors(tail...); return vector<decltype(inner)>(x, inner); }
template<class T> void join(T a){for(auto itr :a){if(itr != *a.begin())cout << " "; cout << itr;} }
using ld  = long double;
using pii = pair<int,int>;
using piii = pair<int,pii>;
int W,H;
int dx[]={0,0,1,-1}, dy[]={1,-1,0,0};
bool valid(int x,int y){return (0<=x&&x<W)&&(0<=y&&y<H);}
signed main(){
    string s; cin >> s;
    int res = 0; rep(i,s.size())res += s[i] - '0';
    cout << (stoll(res)%res "Yes":"No") << endl;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:25:19: error: no matching function for call to 'stoll(ll&)'
   25 |     cout << (stoll(res)%res "Yes":"No") << endl;
      |              ~~~~~^~~~~
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:4180:3: note: candidate: 'long long int std::__cxx11::stoll(const std::string&, std::size_t*, int)'
 4180 |   stoll(const string& __str, size_t* __idx = 0, int __base = 10)
      |   ^~~~~
/usr/include/c++/14/bits/basic_string.h:4180:23: note:   no known conversion for argument 1 from 'll' {aka 'long long int'} to 'const std::string&' {aka 'const std::__cxx11::basic_string<char>&'}
 4180 |   stoll(const string& __str, size_t* __idx = 0, int __base = 10)
      |         ~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:4447:3: note: candidate: 'long long int std::__cxx11::stoll(const std::wstring&, std::size_t*, int)'
 4447 |   stoll(const wstring& __str, size_t* __idx = 0, int __base = 10)
      |   ^~~~~
/usr/include/c++/14/bits/basic_string.h:4447:24: note:   no known conversion for argument 1 from 'll' {aka 'long long int'} to 'const std::wstring&' {aka 'const std::__cxx11::basic_string<wchar_t>&'}
 4447 |   stoll(const wstring& __str, size_t* __idx = 0, int __base = 10)
      |         ~~~~~~~~~~~~~~~^~~~~
a.cc:25:28: error: expected ')' before string constant
   25 |     cout << (stoll(res)%res "Yes":"No") << endl;
      |             ~              ^~~~~~
      |                            )
Language: C++

#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstring>
using namespace std;
int main(){
	int n;cin>>n;
	int ans=0,tmp=n;
	while(tmp){
		ans+=tmp%10;
		tmp/=10;
	}
	if(n%ans==0)cout<<"Yes"<<endl;else cout<<"No<<endl;
}


Compiler output:
a.cc:29:50: warning: missing terminating " character
   29 |         if(n%ans==0)cout<<"Yes"<<endl;else cout<<"No<<endl;
      |                                                  ^
a.cc:29:50: error: missing terminating " character
   29 |         if(n%ans==0)cout<<"Yes"<<endl;else cout<<"No<<endl;
      |                                                  ^~~~~~~~~~
a.cc: In function 'int main()':
a.cc:30:1: error: expected primary-expression before '}' token
   30 | }
      | ^
Language: C++

#include<iostream>  
#include<string>
using namespace std;  
 
int main()
{
	int N;
	cin >> N; 
	if (N%(N%10)==0)
	{
		cout <<"Yes"<< endl; 

	} 
	else
	{
		cout <<"no"<< endl;
	}


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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:12: error: expected ';' before 'while'
    8 |         p=n
      |            ^
      |            ;
    9 |         while(p){
      |         ~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int n2,s;
int main(){
	scanf("%d",&n2);
	n=n2;
	while(n>0){
		s+=n%10;
		n/=10;
	}
	if(n2%s==0)printf("Yes");
	else printf("No");
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'n' was not declared in this scope; did you mean 'yn'?
    6 |         n=n2;
      |         ^
      |         yn
Language: C++

#include <iostream>

using namespace std;

int main()
{
  int n; cin >> n;
  int n_init = n;
  int harshad = 0;

  while (n) {
    harshad += n % 10;
    n /= 10;
  }

  if (n_init % harshad == 0) cout << "Yes" << endl;
  else                       cout << "No" << endl;

  return 0;


Compiler output:
a.cc: In function 'int main()':
a.cc:19:12: error: expected '}' at end of input
   19 |   return 0;
      |            ^
a.cc:6:1: note: to match this '{'
    6 | {
      | ^
Language: C++

#include<iostream>
#include<string>

using namespace std;

int S(int _N) {
	int sum = 0;
	string strN = to_string(_N);

	for (int i = strN.size(); i > 0; --i) {
		sum += _N / std::pow(10, i - 1);
		_N -= pow(10, i - 1);
	}

	return sum;
}

int main() {
	int N;

	cin >> N;

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

	return 0;
}

Compiler output:
a.cc: In function 'int S(int)':
a.cc:11:34: error: 'pow' is not a member of 'std'
   11 |                 sum += _N / std::pow(10, i - 1);
      |                                  ^~~
a.cc:12:23: error: 'pow' was not declared in this scope
   12 |                 _N -= pow(10, i - 1);
      |                       ^~~
Language: C++

#include<iostream>
#include<string>

using namespace std;

int S(int _N) {
	int sum = 0;
	string strN = to_string(_N);

	for (int i = strN.size(); i > 0; --i) {
		sum += _N / pow(10, i - 1);
		_N -= pow(10, i - 1);
	}

	return sum;
}

int main() {
	int N;

	cin >> N;

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

	return 0;
}

Compiler output:
a.cc: In function 'int S(int)':
a.cc:11:29: error: 'pow' was not declared in this scope
   11 |                 sum += _N / pow(10, i - 1);
      |                             ^~~
Language: C++

#include<iostream>
#include<string>

using namespace std;

int S(int _N) {
	int s = 0;
	string strN = to_string(_N);

	for (int i = strN.size(); i > 0; --i) {
		s += _N / pow(10, i - 1);
		_N -= pow(10, i - 1);
	}

	return s;
}

int main() {
	int N;

	cin >> N;

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

	return 0;
}

Compiler output:
a.cc: In function 'int S(int)':
a.cc:11:27: error: 'pow' was not declared in this scope
   11 |                 s += _N / pow(10, i - 1);
      |                           ^~~
Language: C++

#include<iostream>
using namespace std;
int main() {
	int N, n,sum=0;
	int a[9];
	cin >> N;
	n = N;
	for (int i = 0; i < 9; i++) {
		if ((n - n % (int)pow(10,8-i) )/ (int)pow(10, 8 - i) == 0)a[i] = 0;
		else a[i] = (n - n % (int)pow(10, 8 - i)) / (int)pow(10, 8 - i);
		n = n % (int)pow(10, 8 - i);
		sum += a[i];
	}
	if (N%sum == 0)cout << "Yes" << endl;
	else cout << "No" << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:35: error: 'pow' was not declared in this scope
    9 |                 if ((n - n % (int)pow(10,8-i) )/ (int)pow(10, 8 - i) == 0)a[i] = 0;
      |                                   ^~~
a.cc:11:30: error: 'pow' was not declared in this scope
   11 |                 n = n % (int)pow(10, 8 - i);
      |                              ^~~
Language: C++

    #include <iostream>
    #include <algorithm>
        
    int main(void) {
      int n;
      std::cin >> n;
      
      int sum = 0;
      int tmpn = n;
      while(tmpn) {
        sum += tmpn % 10;
        tmpn /= 10;
      }
      
      std::cout << (n % sum == 0) ? "Yes" : "No" << std::endl;
      
      return 0;
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:15:50: error: invalid operands of types 'const char [3]' and '<unresolved overloaded function type>' to binary 'operator<<'
   15 |       std::cout << (n % sum == 0) ? "Yes" : "No" << std::endl;
      |                                             ~~~~~^~~~~~~~~~~~
Language: C++

#include <iostream>
#include <algorithm>
    
int main(void) {
  int n;
  std::cin >> n;
  
  int sum = 0;
  int tmpn = n;
  while(tmpn) {
    sum += tmpn % 10;
    tmpn /= 10;
  }
  
  std::cout << (n % sum == 0) ? "yes" : "no" << std::endl;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:46: error: invalid operands of types 'const char [3]' and '<unresolved overloaded function type>' to binary 'operator<<'
   15 |   std::cout << (n % sum == 0) ? "yes" : "no" << std::endl;
      |                                         ~~~~~^~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
#define INF 1e9
using namespace std;

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

signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);

    int n;
    cin>>n;
    int sum=func(n);
    if(n%sum==0)cout<<"Yes"<<endl;
    else cout<<"No"

}

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

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

int n, s;

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

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

#include <iostream>

using namespace std;

int main() 
{
  int n ;
  cin>>n;
  int num =0;
  temp = 10000000000;
  for(int i = 10;i>0;i++)
  {
   num += n%temp;
   temp = temp/10;  
 
  }
  
  if(n%num ==0)
  {
  cout<<"Yes";
  }
  else
  {
    cout<<"No";
  }
  
  return 0;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:3: error: 'temp' was not declared in this scope; did you mean 'tm'?
   10 |   temp = 10000000000;
      |   ^~~~
      |   tm
Language: Java

import java.util.Scanner;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String n = sc.next();
    int count = 0;
    for(int j = 0; j < n.length(); j++)
      count += n.charAt(j);
    int a = (int)n;
    if(a % count == 0)
      System.out.println("Yes");
    else
      System.out.println("No");
  }
}


Compiler output:
Main.java:9: error: incompatible types: String cannot be converted to int
    int a = (int)n;
                 ^
1 error
Language: Java

import java.util.Scanner;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String n = sc.next();
    int count = 0;
    for(int j = 0; j < n.length(); j++)
      count += n.charAt(j);
    n = (int)n;
    if(n % count == 0)
      System.out.println("Yes");
    else
      System.out.println("No");
  }
}


Compiler output:
Main.java:9: error: incompatible types: String cannot be converted to int
    n = (int)n;
             ^
Main.java:10: error: bad operand types for binary operator '%'
    if(n % count == 0)
         ^
  first type:  String
  second type: int
2 errors
Language: Java

import java.util.Scanner;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String n = sc.next();
    int count = 0;
    for(int j = 0; j < n.length(); j++)
      count += n.charAt(j);
    (int)n;
    if(n % count == 0)
      System.out.println("Yes");
    else
      System.out.println("No");
  }
}


Compiler output:
Main.java:9: error: not a statement
    (int)n;
    ^
1 error
Language: Java

import java.util.Scanner;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String n = sc.next();
    int count = 0;
    for(int j = 0; j < n.length; j++)
      count += n.charAt(j);
    if(n % count == 0)
      System.out.println("Yes");
    else
      System.out.println("No");
  }
}


Compiler output:
Main.java:7: error: cannot find symbol
    for(int j = 0; j < n.length; j++)
                        ^
  symbol:   variable length
  location: variable n of type String
Main.java:9: error: bad operand types for binary operator '%'
    if(n % count == 0)
         ^
  first type:  String
  second type: int
2 errors
Language: Java

import java.util.Scanner;
public class Main{
  public static void main(String[] args){
    String n = sc.next();
    int count = 0;
    for(int j = 0; j < n.length; j++)
      count += n.charAt(j);
    if(n % count == 0)
      System.out.println("Yes");
    else
      System.out.println("No");
  }
}

Compiler output:
Main.java:4: error: cannot find symbol
    String n = sc.next();
               ^
  symbol:   variable sc
  location: class Main
Main.java:6: error: cannot find symbol
    for(int j = 0; j < n.length; j++)
                        ^
  symbol:   variable length
  location: variable n of type String
Main.java:8: error: bad operand types for binary operator '%'
    if(n % count == 0)
         ^
  first type:  String
  second type: int
3 errors
Language: C++


#include <algorithm>
#include <cassert>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
//#include <regex>

/* g++ -g -std=c++0x */
/* g++ -g -std=c++11 */

using namespace std;

// freopen("input.txt", "rt", stdin);
// freopen("output.txt", "wt", stdout);

#define ALL(c)          (c).begin(), (c).end()
#define ALLR(c)         (c).rbegin(), (c).rend()
#define FOR(i,a,b)      for (int i=(a); i < (b); ++i)
#define FORR(i,a,b)     for (int i=(a); i > (b); --i)
#define FOR_ALL(i,c)    for (__typeof((c).begin()) i=(c).begin();   \
                             i != (c).end(); ++i)
#define FOR_ALLR(i,c)   for (__typeof((c).rbegin()) i=(c).rbegin(); \
                             i != (c).rend(); ++i)
#define SZ(array)       (sizeof(array)/sizeof(array[0]))
#define lc(x)           (x<<1)     /* 2*x */
#define rc(x)           (x<<1 | 1) /* 2*x+1 */
#define lowbit(x)       (x & (-x)) /* 0b10100 -> 0b100 */

typedef long long       LL;
typedef map<int,int>    MII;
typedef pair<int,int>   PII;
typedef set<int>        SI;
typedef vector<bool>    VB;
typedef vector<double>  VD;
typedef vector<int>     VI;
typedef vector<string>  VS;

/* check if a key is in container C */
template <class C>
inline bool in_(const typename C::key_type& k, const C& A)
{ return A.find(k) != A.end(); }
inline bool in_(const string& s, const string& S)
{ return S.find(s) != string::npos; }

int main()
{
/* #ifndef ONLINE_JUDGE */
/*     freopen("foo", "rt", stdin); */
/* #endif */
    std::ios::sync_with_stdio(false);

    int N;
    cin >> N;
    int sum = 0;
    int div = N;
    while (div > 0) {
        sum += div % 10;
        div = div/10;    
    }
    if (N % sum == 0)
        cout << "yes" << endl;
    else
        cout << "no" << endl
}


Compiler output:
a.cc: In function 'int main()':
a.cc:82:29: error: expected ';' before '}' token
   82 |         cout << "no" << endl
      |                             ^
      |                             ;
   83 | }
      | ~
Language: C

#include<stdio.h>
int main(void) {
	unsigned long a,c;
	int b;
	b = 0;
	scanf_s("%lu", &a);
	while (a != 0) {
		c = a % 10;
		b += (int)c;
		a /= 10;
	}
	if (a % b == 0)printf("Yes\n");
	else printf("No\n");
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    6 |         scanf_s("%lu", &a);
      |         ^~~~~~~
      |         scanf
Language: C++

#include<stdio.h>
int main()
{
	int N,sum,m;
	m=N/10;
	while (m!=0)
	{sum=sum+N%10;
	 N=N/10;
	 m=N/10;
	}
	if(sum%N=0)
	printf("YES")
	else
	printf("NO");
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:15: error: lvalue required as left operand of assignment
   11 |         if(sum%N=0)
      |            ~~~^~
a.cc:12:22: error: expected ';' before 'else'
   12 |         printf("YES")
      |                      ^
      |                      ;
   13 |         else
      |         ~~~~
Language: C++

#include<stdio.h>
#include<algorithm>
#include<string.h>
#include<iostream>
using namespace std;
int main()
{
	char a[20];
	int n,sum,b[20],i,f;
	gets(a);
	int	l=strlen(a);
	sum=0;
	n=0;
	for(i=0;i<l;i++)
	{
		b[i]=a[i]-'0';
		sum+=b[i];
	}
		f=1;
	for(i=l-1;i>=0;i--)
	{
		n+=b[i]*f;
		f*=10;
	}
//	printf("%d\n",n);
	if(n%sum)
	printf("No\n");
	else
	printf("Yes\n");
	
	return 0;
}

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

#include<stdio.h>
int main()
{
	int N,m,a,b,c,d,x;
	scanf("%d",&N);
	m=N;
	a=m/100000000;
	b=(m-a*100000000)/10000000;
	c=(m-a*100000000-b*10000000)/1000000;
	d=(m-a*100000000-b*10000000-c*1000000)/100000;
	e=(m-a*100000000-b*10000000-c*1000000-d*100000)/10000;
	f=(m-a*100000000-b*10000000-c*1000000-d*100000-e*10000)/1000;
	g=(m-a*100000000-b*10000000-c*1000000-d*100000-e*10000-f*1000)/100;
	h=(m-a*100000000-b*10000000-c*1000000-d*100000-e*10000-f*1000-g*10);
	i=(m-a*100000000-b*10000000-c*1000000-d*100000-e*10000-f*1000-g*100);
	
    x=a+b+c+d+e+f+g+h+i;
    if(N%x==0) 
    {printf("YES");
    printf("\n");
    printf("输入N=%d.S(%d)=");
	}	
	 else 
	{printf("NO");
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: 'e' was not declared in this scope
   11 |         e=(m-a*100000000-b*10000000-c*1000000-d*100000)/10000;
      |         ^
a.cc:12:9: error: 'f' was not declared in this scope
   12 |         f=(m-a*100000000-b*10000000-c*1000000-d*100000-e*10000)/1000;
      |         ^
a.cc:13:9: error: 'g' was not declared in this scope
   13 |         g=(m-a*100000000-b*10000000-c*1000000-d*100000-e*10000-f*1000)/100;
      |         ^
a.cc:14:9: error: 'h' was not declared in this scope
   14 |         h=(m-a*100000000-b*10000000-c*1000000-d*100000-e*10000-f*1000-g*10);
      |         ^
a.cc:15:9: error: 'i' was not declared in this scope
   15 |         i=(m-a*100000000-b*10000000-c*1000000-d*100000-e*10000-f*1000-g*100);
      |         ^
Language: C++

#include<stdio.h>
int main()
{
	int N,m,a,b,c,d,x;
	scanf("%d",&N);
	m=N;
	a=m/100000000;
	b=(m-a*100000000)/10000000;
	c=(m-a*100000000-b*10000000)/1000000;
	d=(m-a*100000000-b*10000000-c*1000000)/100000;
	e=(m-a*100000000-b*10000000-c*1000000-d*100000)/10000;
	f=(m-a*100000000-b*10000000-c*1000000-d*100000-e*10000)/1000;
	g=(m-a*100000000-b*10000000-c*1000000-d*100000-e*10000-f*1000)/100;
	h=(m-a*100000000-b*10000000-c*1000000-d*100000-e*10000-f*1000-g*10);
	i=(m-a*100000000-b*10000000-c*1000000-d*100000-e*10000-f*1000-g*100)
	
    x=a+b+c+d+e+f+g+h+i;
    if(N%x==0) 
    {printf("YES");
    printf("\n");
    printf("输入N=%d.S(%d)=");
	}	
	 else 
	{printf("NO");
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: 'e' was not declared in this scope
   11 |         e=(m-a*100000000-b*10000000-c*1000000-d*100000)/10000;
      |         ^
a.cc:12:9: error: 'f' was not declared in this scope
   12 |         f=(m-a*100000000-b*10000000-c*1000000-d*100000-e*10000)/1000;
      |         ^
a.cc:13:9: error: 'g' was not declared in this scope
   13 |         g=(m-a*100000000-b*10000000-c*1000000-d*100000-e*10000-f*1000)/100;
      |         ^
a.cc:14:9: error: 'h' was not declared in this scope
   14 |         h=(m-a*100000000-b*10000000-c*1000000-d*100000-e*10000-f*1000-g*10);
      |         ^
a.cc:15:9: error: 'i' was not declared in this scope
   15 |         i=(m-a*100000000-b*10000000-c*1000000-d*100000-e*10000-f*1000-g*100)
      |         ^
Language: C++

#include<stdio.h>
#include<string.h>
#include<math.h>
int main()
{
	char s[100];
	int k,sum,s1=0,i,m,t=1,j;
	gets(s);
	k=strlen(s);
	for(i=0;i<k;i++)
	sum=sum+s[i]-48;
	for(i=k-1;i>=0;i--)
	{
		m=k-1-i;
		for(j=0;j<m;j++)
		{
			t=t*10;
		}
		s1=s1+(s[i]-48)*t;
		t=1;
	}
	if(s1%sum==0)
	printf("YES\n");
	if(s1%sum!=0)
	printf("NO\n");
	return 0;
}

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

#include<stdio.h>
#include<string.h>
int main()
{
	char a[15];
	gets(a);

	int n=strlen(a);
	int i,sum=0;
	for(i=0;i<n;i++)
	{
		sum += a[i]-'0';
	}
	
	int num=0;
	
	int t=1;
	for(i=0;i<n;i++)
	{
		num+=a[i]*t;
		t=t*10;
	}
	if(num%sum==0) printf("Yes\n");
	else printf("NO\n");
}

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

# include <stdio.h>

void main(void)
{
	int num,Num;
	scanf("%d",&num);
	Num = num;


	int sum = 0;


	for(;num/10 != 0;)
	{
		sum += num%10;
		num = num/10;
	}
	sum +=num;

	if(Num%sum == 0)
		printf("Yes");
	else
		printf("No");
}


Compiler output:
a.cc:3:1: error: '::main' must return 'int'
    3 | void main(void)
      | ^~~~
Language: C++

#incude<stdio.h>
  main()
  {int a,b,c,d,e;
  scanf("%d",&a);
  b=a/100;
  c=(a-100b)/10;
  d=a-100b-10c;
  e=b+c+d;
  if(a%e==0)printf("yes");
  elese printf("no");
  }

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #incude; did you mean #include?
    1 | #incude<stdio.h>
      |  ^~~~~~
      |  include
a.cc:2:3: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    2 |   main()
      |   ^~~~
a.cc: In function 'int main()':
a.cc:4:3: error: 'scanf' was not declared in this scope
    4 |   scanf("%d",&a);
      |   ^~~~~
a.cc:6:8: error: unable to find numeric literal operator 'operator""b'
    6 |   c=(a-100b)/10;
      |        ^~~~
a.cc:7:7: error: unable to find numeric literal operator 'operator""b'
    7 |   d=a-100b-10c;
      |       ^~~~
a.cc:7:12: error: unable to find numeric literal operator 'operator""c'
    7 |   d=a-100b-10c;
      |            ^~~
a.cc:9:13: error: 'printf' was not declared in this scope
    9 |   if(a%e==0)printf("yes");
      |             ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | #incude<stdio.h>
a.cc:10:3: error: 'elese' was not declared in this scope
   10 |   elese printf("no");
      |   ^~~~~
Language: C++

#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <list>
#include <iomanip>
#include <queue>
#include <functional>
#include <cassert>
#include <cmath>


#define REP(i, n) for(int i = 0; i < (n); i++)
#define FOR(i, a, b) for(int i = (a); i < (b), i++)
#define NL << endl

using namespace std;
using ll = long long;
using ull = unsigned long long;

int main() {

	ll n, t;
	ll s = 0;

	cin >> n;
	t = n;

	while (t > 10) {
		s += t % 10;
		t /= 10;
	}
	s += t;

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


	return 0;


Compiler output:
a.cc: In function 'int main()':
a.cc:43:18: error: expected '}' at end of input
   43 |         return 0;
      |                  ^
a.cc:22:12: note: to match this '{'
   22 | int main() {
      |            ^
Language: C++

#include <iostream>
using namespace std;

int main(){
  string str;
  bool flag;
  int s = 0;
  cin >> str;
  for (int i=0; i < str.length(); i++){
    s += int(str.at(i));
  }
  if (atoi(str) % s == 0) {
    cout << "Yes" << endl;
  }
  else cout << "No" << endl;
  return 0;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:12: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   12 |   if (atoi(str) % s == 0) {
      |            ^~~
      |            |
      |            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)
      |                  ~~~~~~~~~~~~^~~~~~
Language: C

#include <stdio.h>

int main(void)
{
  int N;
  int num = 1000000000;
  int a = 0;
  scanf("%d", N);
  for(i = 0;i < 9;i++){
    a += N % num;
    num / 10;
  }
  if (N % a == 0) printf("Yes");
  else printf("No");
}


Compiler output:
main.c: In function 'main':
main.c:9:7: error: 'i' undeclared (first use in this function)
    9 |   for(i = 0;i < 9;i++){
      |       ^
main.c:9:7: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include<cstdio>
int digit(int number, int digit_n){
    for(int i = 0; i < digit_n; i++){
        number /= 10;
    }
    return number % 10;
}
int main(){
  for

Compiler output:
a.cc: In function 'int main()':
a.cc:9:6: error: expected '(' at end of input
    9 |   for
      |      ^
      |      (
a.cc:9:6: error: expected primary-expression at end of input
a.cc:9:6: error: expected primary-expression at end of input
a.cc:9:6: error: expected ';' at end of input
    9 |   for
      |      ^
      |      ;
a.cc:9:6: error: expected primary-expression at end of input
a.cc:9:6: error: expected ')' at end of input
    9 |   for
      |      ^
      |      )
a.cc:9:6: error: expected statement at end of input
a.cc:9:6: error: expected '}' at end of input
a.cc:8:11: note: to match this '{'
    8 | int main(){
      |           ^
Language: C++

#include<iostream>
using namespace std;
int main() {
  int n, s=0;
  cin >> n;
  int 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:12:29: error: expected '}' at end of input
   12 |   else cout << "No" << endl;
      |                             ^
a.cc:3:12: note: to match this '{'
    3 | int main() {
      |            ^
Language: C

#include<stdio.h>

int main(void)
{
   int s=0,a,n;
   scanf("%d",&n);

   a=n;
   while(a>0){
     s+= a%10;
     a = a/10;
   }
   if(n%s ==0)
     printf("Yes\n");
   else
     printf("No\n");
   return 0;
}
~                                                                               
~                       

Compiler output:
main.c:19:1: error: expected identifier or '(' before '~' token
   19 | ~
      | ^
Language: C++

#include<stdio.h>

int main(void)
{
   int s=0,a,n;
   scanf("%d",&n);

   a=n;
   while(a>0){
     s+= a%10;
     a = a/10;
   }
   if(n%s ==0)
     printf("Yes\n");
   else
     printf("No\n");
   return 0;
}
~                                                                               
~                       

Compiler output:
a.cc:20:1: error: expected class-name before '~' token
   20 | ~
      | ^
Language: C

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

int main (void)
{
   int n,s=0,l,i;
   char num[11];
   scanf("%d",n)

   snprintf(num,11,"%d",n);
   l=strlen(num);

   for(i=0;i<l;i++)
      s+=num[i]-'0';
      
   if(n%s==0) printf("yes\n");
   else printf("no\n");

   return 0;
}



Compiler output:
main.c: In function 'main':
main.c:8:17: error: expected ';' before 'snprintf'
    8 |    scanf("%d",n)
      |                 ^
      |                 ;
    9 | 
   10 |    snprintf(num,11,"%d",n);
      |    ~~~~~~~~
Language: C++

import java.util.*;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int n = N, s = 0;
		for(int i = 0;i < 9;i++) {
			s += n % 10;
			n = n / 10;
		}
		if(N % s == 0) System.out.println("Yes");
		else System.out.println("No");
	}
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: expected unqualified-id before 'public'
    2 | public class Main {
      | ^~~~~~
Language: C++

#include <iostream>
#include <string>

int main()
{
  std::string S;
  int n = 0;
  std::cin >> S;
  for(int i = 0;i < S.size(); ++i){
    n += (S[i] - '0');
  }
  ////↓でもok
  //for(auto v : S){
  //  n += (v - '0');
  //}
  std::cout << n << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:21: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   16 |   std::cout << n << endl;
      |                     ^~~~
      |                     std::endl
In file included from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <iostream>
#include <string>

int main()
{
  std::string S;
  int n = 0;
  std::cin >> S;
  for(int i = 0;i < S.size(); ++i){
    n += (S[i] - '0');
  }
  ////↓でもok
  //for(auto v : S){
  //  n += (v - '0');
  //}
  out << n << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:3: error: 'out' was not declared in this scope
   16 |   out << n << endl;
      |   ^~~
a.cc:16:15: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   16 |   out << n << endl;
      |               ^~~~
      |               std::endl
In file included from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <iostream>
#include <math.h>

using namespace std;

int main(){
    int N,tmp,S=0,i;
    cin >> N;
    tmp = N;

    for (i=1;i<=10;i++){
            
        // S = S + N % (int(pow(10.0, double(i))));
        S = S + N % 10;
        N = N / 10;
    }

    if(tmp%S==0){
        cout << "Yes"
    }else{
        cout << "No"
    }

    // cout << S << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:22: error: expected ';' before '}' token
   19 |         cout << "Yes"
      |                      ^
      |                      ;
   20 |     }else{
      |     ~                 
a.cc:21:21: error: expected ';' before '}' token
   21 |         cout << "No"
      |                     ^
      |                     ;
   22 |     }
      |     ~