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

#include<stdio.h>
#include<string.h>
int main(void){
  int i,sum=0,num_int=0;
  char num[200];
  scanf("%s",num);
  for(i=0;i<string(num);i++){
    sum+=(num[i]-'0');
    num_int+=(num[i]-'0');
    num_int*=10;
  }
  if((num_int/10)%sum==0){
    printf("Yes");
  }else{
    printf("No");
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:13: error: implicit declaration of function 'string'; did you mean 'stdin'? [-Wimplicit-function-declaration]
    7 |   for(i=0;i<string(num);i++){
      |             ^~~~~~
      |             stdin
Language: C++

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

int main(){
    string N;
    int a=0;
    int t;
    cin >>N;
    for (int i=0;i<length;i++)
    {
        a=a+N[i]-'0';
    }
    cout <<a;
    stringstream hi(N);
    hi>>t;
    if (t%a==0){
        cout <<"Yes";
    }
    else {
    cout <<"No";
    }
    return 0;
}


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

//https://atcoder.jp/contests/abc101/tasks/abc101_b
//2020-03-13
//18:50:48

#include <iostream>
#include <string>
#include <vector>
#include <array>
#include <queue>
#include <stack>
#include <deque>
#include <algorithm>
#include <functional>
#include <cmath>
#include <map>
#include <iomanip>
using namespace std;

int main()
{
    char str[10];
    cin >> str;
    int A=0,B=0;
    for(int i=0;i<strlen(str);i++){
        A = A*10 + (int)str[i] - 48;
        B += (int)str[i]-48; 
    }
    if(A%B==0){
        cout << "Yes\n";
    }else{
        cout << "No\n";
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:19: error: 'strlen' was not declared in this scope
   24 |     for(int i=0;i<strlen(str);i++){
      |                   ^~~~~~
a.cc:17:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   16 | #include <iomanip>
  +++ |+#include <cstring>
   17 | using namespace std;
Language: Java

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    
    long N = nextLong();
    long a = 0;
    long c_N = N;
    
    while (N != 0) {
      a += N % 10;
      N /= 10;
    }
    
    System.out.println(a % c_N == 0 ? "Yes" : "No");
  }
}


Compiler output:
Main.java:7: error: cannot find symbol
    long N = nextLong();
             ^
  symbol:   method nextLong()
  location: class Main
1 error
Language: C++

#include<iostream>
#include<cmath>
using namespace std;
int main()
{
    char x[9];
    int num=0,len,ans=0;
    cin>>x;
    len=strlen(x);
    for(int i=0;i<len;i++)
    num+=x[i]-'0';
    for(int i=0;i<len;i++)
    {
    	ans+=(x[i]-'0')*pow(10,len-1-i);
    }
    if(ans%num==0)cout<<"Yes";
    else cout<<"No";
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: 'strlen' was not declared in this scope
    9 |     len=strlen(x);
      |         ^~~~~~
a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include<cmath>
  +++ |+#include <cstring>
    3 | using namespace std;
Language: C++

#include <iostream>
using namespace std;
void func() {
    int N ;
    cin  >> N;
    int sum = 0;
    int temp = N;
    while (temp > 0) {
        sum += temp % 10;
        temp /= 10;
    }
    cout << (N % sum == 0 ? "Yes" : "No") << endl;
}

int main() {
    func();
    return 0;


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

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

int main() {
    string n;
    cin >> n;
    int s=0;
    for(int i=0;i<n.size();i++){
        s += std::stoi(n.at(i));
    }
    int t = std::stoi(n);
    if(t%s==0) cout << "Yes";
    else cout << "No";
}

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

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

int main() {
    string n;
    cin >> n;
    int s=0;
    for(int i=0;i<s.size();i++){
        s += std::stoi(n.at(i));
    }
    int t = std::stoi(n);
    if(t%s==0) cout << "Yes";
    else cout << "No";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:21: error: request for member 'size' in 's', which is of non-class type 'int'
    8 |     for(int i=0;i<s.size();i++){
      |                     ^~~~
a.cc:9:23: error: no matching function for call to 'stoi(__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type&)'
    9 |         s += std::stoi(n.at(i));
      |              ~~~~~~~~~^~~~~~~~~
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:4164:3: note: candidate: 'int std::__cxx11::stoi(const std::string&, std::size_t*, int)'
 4164 |   stoi(const string& __str, size_t* __idx = 0, int __base = 10)
      |   ^~~~
/usr/include/c++/14/bits/basic_string.h:4164:22: note:   no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const std::string&' {aka 'const std::__cxx11::basic_string<char>&'}
 4164 |   stoi(const string& __str, size_t* __idx = 0, int __base = 10)
      |        ~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:4432:3: note: candidate: 'int std::__cxx11::stoi(const std::wstring&, std::size_t*, int)'
 4432 |   stoi(const wstring& __str, size_t* __idx = 0, int __base = 10)
      |   ^~~~
/usr/include/c++/14/bits/basic_string.h:4432:23: note:   no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const std::wstring&' {aka 'const std::__cxx11::basic_string<wchar_t>&'}
 4432 |   stoi(const wstring& __str, size_t* __idx = 0, int __base = 10)
      |        ~~~~~~~~~~~~~~~^~~~~
Language: C++

#include <iostream>
#include <bits/stdc++.h>
#include <string>
using namespace std;
int main(){
  long long int n;
  cin>>n;
  int s_n=0;
  string s=to_string(n);
  for(int i=0;i<strlen(s);i++){
    s_n+=(s[i]-'0');
  }
  if(n%s_n ==0) cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:24: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   10 |   for(int i=0;i<strlen(s);i++){
      |                        ^
      |                        |
      |                        std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/cstring:43,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:121,
                 from a.cc:2:
/usr/include/string.h:407:35: note:   initializing argument 1 of 'size_t strlen(const char*)'
  407 | extern size_t strlen (const char *__s)
      |                       ~~~~~~~~~~~~^~~
Language: C++

#include <iostream>
#include <bits/stdc++.h>
#include <stream>
using namespace std;
int main(){
  long long int n;
  cin>>n;
  int s_n=0;
  string s=to_string(n);
  for(int i=0;i<strlen(s);i++){
    s_n+=(s[i]-'0');
  }
  if(n%s_n ==0) cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
  return 0;
}

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


#include <iostream>
using namespace std;

int main()
{
  int N;
  cin >> N;
  auto _N = N;
  int SN = 0;
  while (0 < N_)
  {
    SN += _N%10;
    _N /= 10;
  }
  cout << ((0 == N%SN) ? "Yes" : "No");
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:14: error: 'N_' was not declared in this scope; did you mean 'N'?
   11 |   while (0 < N_)
      |              ^~
      |              N
Language: Java

mport java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		sc.close();

		int s = 0;
		int n2 = n;
		while (n2 > 0) {
			s += n2 % 10;
			n2 /= 10;
		}
		if (n % s == 0) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}
}


Compiler output:
Main.java:1: error: class, interface, enum, or record expected
mport java.util.Scanner;
^
1 error
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin >> N;
  string s = to_string(N);
  int S = 0;
  for (int i = 0; i < S.size(); i++) S += s[i] - '0';
  cout << (N % S == 0 ? "Yes" : "No");
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:25: error: request for member 'size' in 'S', which is of non-class type 'int'
    8 |   for (int i = 0; i < S.size(); i++) S += s[i] - '0';
      |                         ^~~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: expected ',' or ';' before 'while'
    8 |   while(n>0)
      |   ^~~~~
Language: C++

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

#define int long long

signed main(){
  int n;
  cin >> n;
  
  int sum = 0;
  while(n){
    ans+=n%10;
    n/=10;
  }
  cout << sum << endl;
  return 0;}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   12 |     ans+=n%10;
      |     ^~~
      |     abs
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:10:13: error: 'to_Int' was not declared in this scope
   10 |   int ans = to_Int(N);
      |             ^~~~~~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:13: error: 'to_int' was not declared in this scope; did you mean 'u_int'?
   10 |   int ans = to_int(N);
      |             ^~~~~~
      |             u_int
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    string msg;
    cin >> n;
    msg = n % S(n) == 0 ? "Yes" : "No";

    cout << msg << endl;

    return 0;
}

int S(int n)
{
    int result;
    string str;
    str = to_string(n);
    for (char i : str)
    {
        result += (int)i;
    }

    return result;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:15: error: 'S' was not declared in this scope
    8 |     msg = n % S(n) == 0 ? "Yes" : "No";
      |               ^
Language: C

#include<stdio.h>

int main()
{
int n,sum=0;
 scanf("%d",&n);
 while(n!=0)
{
 int k = n%10;
sum+=k;
n=n/10;
}
if(sum%n == 0)
printf("Yes");
else
printf("No");



Compiler output:
main.c: In function 'main':
main.c:16:1: error: expected declaration or statement at end of input
   16 | printf("No");
      | ^~~~~~
Language: C

#include<stdio.h>

int main()
{
 scanf("%d",&n);
 while(n!=0)
{
 int k = n%10;
sum+=k;
n=n/10;
}
if(sum%n == 0)
printf("Yes");
else
printf("No");



Compiler output:
main.c: In function 'main':
main.c:5:14: error: 'n' undeclared (first use in this function)
    5 |  scanf("%d",&n);
      |              ^
main.c:5:14: note: each undeclared identifier is reported only once for each function it appears in
main.c:9:1: error: 'sum' undeclared (first use in this function)
    9 | sum+=k;
      | ^~~
main.c:15:1: error: expected declaration or statement at end of input
   15 | printf("No");
      | ^~~~~~
Language: C++

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

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

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

#include<iostream>
#include<string>
#include<vector>
using namespace std;
int main() {
	int a=0,b=0;
	string s;
	cin >> s;
	for (int i = 0; i < s.size(); i++) {
		a += s[i] - '0';
		b += pow(10, s.size - 1 - i) * (s[i] - '0');
	}
	if (b % a == 0)cout << "Yes" << endl;
	else cout << "No" << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:32: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   11 |                 b += pow(10, s.size - 1 - i) * (s[i] - '0');
      |                              ~~^~~~
      |                                    ()
a.cc:11:22: error: 'pow' was not declared in this scope
   11 |                 b += pow(10, s.size - 1 - i) * (s[i] - '0');
      |                      ^~~
Language: C++

#include <bits/stdc++.h>
#define REP(i,n) for (int i = 0; i < (n); i++)
#define RREP(i, s, n) for (int i = s; i < (n); i++)
#define ALL(a) a.begin(), a.end()
#define RALL(a) a.rbegin(), a.rend()
#define maxs(x,y) x = max(x, y)
#define mins(x,y) x = min(x, y)
using namespace std;
using ll = long long;
typedef pair<int, int> pint;
typedef pair<ll, ll> pll;
const ll MOD = 1000000007;
const ll INF = MOD * MOD;
const int inf = (1<<29);

int main() {

    string N;
    cin >> N;
    
    int s = 0;
    for(int i = 0; i < N.size(); i++) {
        s += N[i] - '0';
    }

    cout << ((int)N % s == 0) ? "Yes" : "No" << endl;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:26:14: error: invalid cast from type 'std::string' {aka 'std::__cxx11::basic_string<char>'} to type 'int'
   26 |     cout << ((int)N % s == 0) ? "Yes" : "No" << endl;
      |              ^~~~~~
a.cc:26:46: error: invalid operands of types 'const char [3]' and '<unresolved overloaded function type>' to binary 'operator<<'
   26 |     cout << ((int)N % s == 0) ? "Yes" : "No" << endl;
      |                                         ~~~~~^~~~~~~
Language: C++

#include <bits/stdc++.h>
#define REP(i,n) for (int i = 0; i < (n); i++)
#define RREP(i, s, n) for (int i = s; i < (n); i++)
#define ALL(a) a.begin(), a.end()
#define RALL(a) a.rbegin(), a.rend()
#define maxs(x,y) x = max(x, y)
#define mins(x,y) x = min(x, y)
using namespace std;
using ll = long long;
typedef pair<int, int> pint;
typedef pair<ll, ll> pll;
const ll MOD = 1000000007;
const ll INF = MOD * MOD;
const int inf = (1<<29);

int main() {

    string N;
    cin >> N;
    
    int s = 0;
    for(int i = 0; i < S.size(); i++) {
        s += S[i] - '0';
    }

    cout << ((int)N % s == 0) ? "Yes" : "No" << endl;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:22:24: error: 'S' was not declared in this scope
   22 |     for(int i = 0; i < S.size(); i++) {
      |                        ^
a.cc:26:14: error: invalid cast from type 'std::string' {aka 'std::__cxx11::basic_string<char>'} to type 'int'
   26 |     cout << ((int)N % s == 0) ? "Yes" : "No" << endl;
      |              ^~~~~~
a.cc:26:46: error: invalid operands of types 'const char [3]' and '<unresolved overloaded function type>' to binary 'operator<<'
   26 |     cout << ((int)N % s == 0) ? "Yes" : "No" << endl;
      |                                         ~~~~~^~~~~~~
Language: C++

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

int main(){
  int n;
  cin >> n;
  string sn;
  sn = to_string(n);
  int m=0;
  for(int i=0; i<sn.size(); i++){
    m += (int)(sn.at(i))-48;
  }
  if(n%m==0)cout << "Yes" << endl;
  else cout << "No" << endl;
  
  return 0;
}
  

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

#include <bits/stdc++.h>
 
int main()
{
	int N;
	int sum = 0;
  	cin >> N;
	int tmp = N;
	while (tmp > 0) {
		sum += tmp % 10;
		tmp /= 10;
	}
	if (N % sum == 0) {
		puts("Yes");
	} else {
		puts("No");
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |         cin >> N;
      |         ^~~
      |         std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
Language: C

nt main()
{
	int a,b=0,c;
	scanf("%d",&a);
	c=a;
	while(a>0)
	{
		b=a%10+b;
		a=a/10;
	}
	if(c%b==0)
	printf("Yes");
	else
	printf("No");
	return 0;
}


Compiler output:
main.c:1:1: error: unknown type name 'nt'; did you mean 'int'?
    1 | nt main()
      | ^~
      | int
main.c: In function 'main':
main.c:4:9: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    4 |         scanf("%d",&a);
      |         ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | nt main()
main.c:4:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    4 |         scanf("%d",&a);
      |         ^~~~~
main.c:4:9: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:12:9: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   12 |         printf("Yes");
      |         ^~~~~~
main.c:12:9: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:12:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:12:9: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:14:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   14 |         printf("No");
      |         ^~~~~~
main.c:14:9: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C++

// Auhthor:: MOHAMMAD FAISAL
// BEGINNING WITH THE NAME OF ALMIGHTY GOD ALLAH 
#include<bits/stdc++.h>
using namespace std;
bool solve(long long n)
{
  	long long temp = n;
   	long long sum=0;
  	while(n>0)
    {
      sum+=(n%10);
      n/=10;
    }
  	(sum%n==0) ? return true: return false;
}
int main()
{
  
	long long n;
    cin >> n;
  	(solve) ? cout<<"Yes": cout<<"No";
 	return 0;
}


Compiler output:
a.cc: In function 'bool solve(long long int)':
a.cc:14:22: error: expected primary-expression before 'return'
   14 |         (sum%n==0) ? return true: return false;
      |                      ^~~~~~
a.cc:14:21: error: expected ':' before 'return'
   14 |         (sum%n==0) ? return true: return false;
      |                     ^~~~~~~
      |                     :
a.cc:14:22: error: expected primary-expression before 'return'
   14 |         (sum%n==0) ? return true: return false;
      |                      ^~~~~~
a.cc:15:1: warning: no return statement in function returning non-void [-Wreturn-type]
   15 | }
      | ^
Language: C++

// Auhthor:: MOHAMMAD FAISAL
// BEGINNING WITH THE NAME OF ALMIGHTY GOD ALLAH 
#include<bits/stdc++.h>
using namespace std;
bool solve(long long n)
{
  	long long = temp;
 	temp = n;
   	long long sum=0;
  	while(n>0)
    {
      sum+=(n%10);
      n/=10;
    }
  	(sum%n==0) ? return true: return false;
}
int main()
{
  
	long long n;
    cin >> n;
  	(solve) ? cout<<"Yes": cout<<"No";
 	return 0;
}

Compiler output:
a.cc: In function 'bool solve(long long int)':
a.cc:7:19: error: expected unqualified-id before '=' token
    7 |         long long = temp;
      |                   ^
a.cc:8:9: error: 'temp' was not declared in this scope; did you mean 'tm'?
    8 |         temp = n;
      |         ^~~~
      |         tm
a.cc:15:22: error: expected primary-expression before 'return'
   15 |         (sum%n==0) ? return true: return false;
      |                      ^~~~~~
a.cc:15:21: error: expected ':' before 'return'
   15 |         (sum%n==0) ? return true: return false;
      |                     ^~~~~~~
      |                     :
a.cc:15:22: error: expected primary-expression before 'return'
   15 |         (sum%n==0) ? return true: return false;
      |                      ^~~~~~
a.cc:16:1: warning: no return statement in function returning non-void [-Wreturn-type]
   16 | }
      | ^
Language: C++

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

int main() {
  
  int n;
  cin >> n;
  
  int m=n;
  int s=0;
  bool t=true;
  while (t) {
    s++;
    m/=10;
    if (m==0) t=false;
  }
  
  int m=n;
  int u=0;
  for (int i=0; i<s; i++) {
    u+=m%10;
    m/=10;
  }
  
  if (n%u==0) cout << "Yes" << endl;
  else cout << "No" << endl;
}

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

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

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


#include<iostream>
#include<sstream> 


using namespace std;

int main()
{
	int Values[9];
	char inputs[9];
	string num = "";
	string firsts;
	int result = 0;
	int ne;
	cin >> firsts;
	for (int i = 0; i < firsts.length(); i++) {
		inputs[i] = firsts[i];
		num += inputs[i];
		Values[i] = inputs[i] - '0';
		result += Values[i];
	}
	stringstream geek(num);
	geek >> ne;
	if (ne % result) {
		cout << "No";
	}
	else {
		cout << "Yes";
	}

	return 0;	


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

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

int main() {
  int a;
  cin >> a;
  
  
  if(a%(a%10+(a%100)/10+(a%1000)/100+(a%10000)/1000+(a%100000)/10000+(a%1000000)/100000+(a%10000000)/1000000+(a%100000000)/10000000+(a%1000000000)/100000000+(a/1000000000) == 0){
    cout <<"Yes" << endl;
  }
    else{
      cout <<"No" <<endl;
    }
  }


Compiler output:
a.cc: In function 'int main()':
a.cc:9:178: error: expected ')' before '{' token
    9 |   if(a%(a%10+(a%100)/10+(a%1000)/100+(a%10000)/1000+(a%100000)/10000+(a%1000000)/100000+(a%10000000)/1000000+(a%100000000)/10000000+(a%1000000000)/100000000+(a/1000000000) == 0){
      |     ~                                                                                                                                                                            ^
      |                                                                                                                                                                                  )
a.cc:15:3: error: expected primary-expression before '}' token
   15 |   }
      |   ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
    int N;
    cin >> N;
    int answer = 0,cnt = 100;
    while((N % cnt) != N){
        int sita = N % cnt;
        answer += sita - N % (cnt / 10);
        cnt *= 10;
    }
    answer += N % 10;
    if(answer % N == 0){
        cout << "Yes";
    }
    else cout << "No";
    //もうちょいスマートに書ける



    return 0;

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

#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
  int a,b,c=0;
  cin>>a;
  b=a;
  while(true){
    if(b==0) break;
    c=c+b%10;
    b/=10;
  }
  if(a%c==0) cout<<'Yes';
  else cout"\n";
  cout<<"\n";
  }

Compiler output:
a.cc:13:20: warning: multi-character character constant [-Wmultichar]
   13 |   if(a%c==0) cout<<'Yes';
      |                    ^~~~~
a.cc: In function 'int main()':
a.cc:14:12: error: expected ';' before string constant
   14 |   else cout"\n";
      |            ^~~~
      |            ;
Language: C++

#include<iostream>

using namespace std;

int main(void){

  long long n;
  cin>>n;
   
  int tmp=n,ans=0;
  while(tmp>0){
    tmp /=10;
    ans +=tmp;
  }
  
  if(n%ans==0){
    cout<<"Yes";
  }
  else{
    cout<<"No":
  }
}
    
    

Compiler output:
a.cc: In function 'int main()':
a.cc:20:15: error: expected ';' before ':' token
   20 |     cout<<"No":
      |               ^
      |               ;
Language: C

#include <bits/stdc++.h>


int main() {
    int t, rem;
    long long int n, sum=0;

    scanf("%d", &t);
    while(t--){
        scanf("%lld", &n);
        while(n!=0){
        rem=n%10;
        sum=sum+rem;
        n=n/10;
        }
    printf("%lld\n", sum);
    sum=0;

    }




    return 0;
}


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

clude <stdio.h>
int main(){
    int p,n,s,d;
    scanf("%d", &p);
    n=p;
    s=0;
    while (n!=0) {
        d = n % 10;
        n = n / 10;
        s = s + d;
    }
    if(p%s==0){
        printf("Yes\n");
    }
    else{
        printf("No\n");
    }
 
    return 0;
}

Compiler output:
main.c:1:7: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | clude <stdio.h>
      |       ^
Language: C++

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

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



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

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

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



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

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:11:27: error: request for member 'size' in 'N', which is of non-class type 'int'
   11 |     for (int i = 0; i < N.size(); i++){
      |                           ^~~~
a.cc:12:29: error: invalid operands of types 'int' and '__gnu_cxx::__promote<double>::__type' {aka 'double'} to binary 'operator%'
   12 |         S += N/pow(10,i) - N%pow(10,i);
      |                            ~^~~~~~~~~~
      |                            |    |
      |                            int  __gnu_cxx::__promote<double>::__type {aka double}
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:11:27: error: request for member 'size' in 'N', which is of non-class type 'int'
   11 |     for (int i = 0; i < N.size(); i++){
      |                           ^~~~
a.cc:12:20: error: invalid type argument of unary '*' (have 'int')
   12 |         S += N/(10**i) - N%(10**i);
      |                    ^~
a.cc:12:32: error: invalid type argument of unary '*' (have 'int')
   12 |         S += N/(10**i) - N%(10**i);
      |                                ^~
Language: C++

#include<bits/stdc++.h>
#define all(a) a.begin(),a.end()
#define sz size() 
using namespace std;
string s;
int t[10]={1,10,1e2,1e3,1e4,1e5,1e6,1e7,1e8,1e9},a=0,b=0;
int main(void){
	cin>>s;
	reverse(all(s));
	for(int i=0;i<s.sz;i++)a+=s[i]-'0';
	for(int i=0;i<s.sz;i++)b+=(s[i]-'0')*t[i];
//	cout<<a<<' '<<b<<endl;
	if(b%a)cout<<"No";
	else cout<<"Yes";
	return 0;
}

Compiler output:
a.cc:6:17: error: narrowing conversion of '1.0e+2' from 'double' to 'int' [-Wnarrowing]
    6 | int t[10]={1,10,1e2,1e3,1e4,1e5,1e6,1e7,1e8,1e9},a=0,b=0;
      |                 ^~~
a.cc:6:21: error: narrowing conversion of '1.0e+3' from 'double' to 'int' [-Wnarrowing]
    6 | int t[10]={1,10,1e2,1e3,1e4,1e5,1e6,1e7,1e8,1e9},a=0,b=0;
      |                     ^~~
a.cc:6:25: error: narrowing conversion of '1.0e+4' from 'double' to 'int' [-Wnarrowing]
    6 | int t[10]={1,10,1e2,1e3,1e4,1e5,1e6,1e7,1e8,1e9},a=0,b=0;
      |                         ^~~
a.cc:6:29: error: narrowing conversion of '1.0e+5' from 'double' to 'int' [-Wnarrowing]
    6 | int t[10]={1,10,1e2,1e3,1e4,1e5,1e6,1e7,1e8,1e9},a=0,b=0;
      |                             ^~~
a.cc:6:33: error: narrowing conversion of '1.0e+6' from 'double' to 'int' [-Wnarrowing]
    6 | int t[10]={1,10,1e2,1e3,1e4,1e5,1e6,1e7,1e8,1e9},a=0,b=0;
      |                                 ^~~
a.cc:6:37: error: narrowing conversion of '1.0e+7' from 'double' to 'int' [-Wnarrowing]
    6 | int t[10]={1,10,1e2,1e3,1e4,1e5,1e6,1e7,1e8,1e9},a=0,b=0;
      |                                     ^~~
a.cc:6:41: error: narrowing conversion of '1.0e+8' from 'double' to 'int' [-Wnarrowing]
    6 | int t[10]={1,10,1e2,1e3,1e4,1e5,1e6,1e7,1e8,1e9},a=0,b=0;
      |                                         ^~~
a.cc:6:45: error: narrowing conversion of '1.0e+9' from 'double' to 'int' [-Wnarrowing]
    6 | int t[10]={1,10,1e2,1e3,1e4,1e5,1e6,1e7,1e8,1e9},a=0,b=0;
      |                                             ^~~
Language: C++

#include <iostream>
using namespace std;

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

	int s = 0;
	{
		long long nc = n;
		int temp = 0;
		for (int i = 9; 0 <= i; --i) {
			long long p1 = pow(10, i + 1);
			nc -= p1 * temp;
			long long p2 = pow(10, i);
			temp = nc / p2;
			s += temp;
		}
	}

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

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:40: error: 'pow' was not declared in this scope
   14 |                         long long p1 = pow(10, i + 1);
      |                                        ^~~
Language: C

import java.util.*;
class Main{

     public static void main(String []args){
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int sum = 0 ;
        int next = n ;
        for(int i = 0 ; next!=0 ; i++){
            int digit = next%10 ;
            sum+=digit ;
             next = next/10 ;
        }
        if(n%sum== 0){
            System.out.println("Yes");
        }else{
            System.out.println("No");
        }
        
     }
}

Compiler output:
main.c:1:1: error: unknown type name 'import'
    1 | import java.util.*;
      | ^~~~~~
main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    1 | import java.util.*;
      |            ^
main.c:2:1: error: unknown type name 'class'
    2 | class Main{
      | ^~~~~
main.c:2:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
    2 | class Main{
      |           ^
Language: C++

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

int main() {
    int n;
    cin >> n;
    int sum = 0;
    for(char c : to_string(n)) {
        sum += c - '0';
    }
    cout << (n % c ? "No" : "Yes") << '\n';
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:18: error: 'c' was not declared in this scope
   11 |     cout << (n % c ? "No" : "Yes") << '\n';
      |                  ^
Language: C++

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

int SumOfEachDits(long long N){
	int ans = 0;
	int S = to_string(N);
	for(int i = 0; i < S.size(); i++){
		ans += (N % 10);
		ans /= 10;
	}
	return ans;
}

int main(){
	long long A;
	cin >> A;
	int Sn = SumOfEachDits(A);
	bool jdg = false;
	if(A % Sn == 0) jdg = true;
	if(jdg) cout << "Yes" << endl;
	else cout << "No" << endl;
}

Compiler output:
a.cc: In function 'int SumOfEachDits(long long int)':
a.cc:6:26: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'int' in initialization
    6 |         int S = to_string(N);
      |                 ~~~~~~~~~^~~
      |                          |
      |                          std::string {aka std::__cxx11::basic_string<char>}
a.cc:7:30: error: request for member 'size' in 'S', which is of non-class type 'int'
    7 |         for(int i = 0; i < S.size(); i++){
      |                              ^~~~
Language: C++

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

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

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:18:14: error: expected primary-expression before ',' token
   18 |   else cout <, "No" << endl;
      |              ^
a.cc:18:21: error: invalid operands of types 'const char [3]' and '<unresolved overloaded function type>' to binary 'operator<<'
   18 |   else cout <, "No" << endl;
      |                ~~~~~^~~~~~~
Language: C++

#include<iostream>
using namespace std;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: expected ',' or ';' before 'while'
    8 |   while(true){
      |   ^~~~~
Language: C++

#include<iostream>
using namespace std;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:12:18: error: expected ')' before '$$'
   12 |       if(N%S == 0 $$ S != 0){
      |         ~        ^~~
      |                  )
Language: C

#pragma Grem optimize ("O3")
#include <bits/stdc++.h>

using namespace std ;

#define sz(v) (int)v.size()
#define ll long long
#define all(v)  v.begin() , v.end()
#define rall(v)  v.rbegin() , v.rend()
#define pf push_front
#define pb push_back
#define fast FastInputOutput() ;
#define Clear( container , value ) memset( container , value , sizeof container )
#define PI acos( -1.0 )
#define forn( t , v , be , n ) for( t v = be ; v < n ; v++ )
#define fore( x , j ) for( auto x : j )
#define se second
#define fr first
//#define c_b fflush(stdin);

const ll Long_max = numeric_limits < ll > :: max() ;
const int Int_max = numeric_limits < int > :: max() ;

int dx[ ] = { 1, -1, 0, 0, 1, -1, -1, 1 } ;
int dy[ ] = { 0, 0, -1, 1, 1, -1, 1, -1 } ;

void File_input( string pathIn ) {
    freopen( pathIn.c_str(), "r", stdin ) ;
}

void File_output( string pathOut ) {
    freopen( pathOut.c_str(), "w", stdout ) ;
}

int msg() {
    srand( time( 0 ) ) ;
    vector < string > st = {
        "Wish everyone high ratings!",
        "Good luck!",
        "Have fun!",
        "Please, read all the problems!",
        "Go Go fight!"
    } ;
    cerr << st[ rand() % sz( st ) ] ;
    return 0 ;
}


void FastInputOutput() {
    ios_base :: sync_with_stdio( 0 ) ;
    cin.tie( 0 ) ;
    cout.tie( 0 ) ;
}

int n ;
int sum = 0 ;
int tmp ;

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




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

#include <bits/stdc++.h>
using namespace std;
//*******************
// Mahmoud Magdy    *
//*******************
#define ll long long
#define endl "\n"

void fast()
{
    ios_base :: sync_with_stdio( 0 ) ;
    cin.tie( 0 ) ;
    cout.tie( 0 ) ;
}
inline int D()
{
    int m ;
    cin>>m;
    return m ;
}
inline ll lD()
{
    ll m ;
    cin>>m;
    return m ;
}
inline double dD()
{
    double m ;
    cin>>m;
    return m ;
}
int main()
{
fast();
sum digit
int t=D();
int n=t;
ll sum=0;
while(t){
    sum+=t%10;
    t/=10;
}
if(n%sum==0)
    cout<<"Yes"<<endl;
else
    cout<<"No"<<endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:36:1: error: 'sum' was not declared in this scope
   36 | sum digit
      | ^~~
a.cc:38:7: error: 't' was not declared in this scope
   38 | int n=t;
      |       ^
Language: Java

import java.util.Scanner;
	public class problem4 {
		private static Scanner k;
	
		public static void main(String args[]){ 
			 k = new Scanner(System.in);
			 String stringToCheck= k.nextLine(); 
		        int temp = 0; 
		        int j,kr;
		        String Str;
		        kr=Integer.parseInt(stringToCheck);
		     
		  for (int i=0; i<stringToCheck.length(); i++){ 
		              
		            Str=String.valueOf(stringToCheck.charAt(i));
		            j=Integer.parseInt(Str);
		            temp=temp+j;
		     }  
		  if(kr%temp==0)System.out.println("Yes"); 
		  else {
			  System.out.println("No");
		  }
		        } 
	}
		      

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

#include <bits/stdc++.h>
#define fi first
#define se second
#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define sort(a) sort((a).begin(),(a).end())
#define rev(a) reverse((a).begin(),(a).end())
using db = double;
using namespace std;
typedef long long ll;

int func(int x) {
  if (x < 10) return x;
  else 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;
  return 0;
}


Compiler output:
a.cc: In function 'int func(int)':
a.cc:14:34: error: expected ';' before '}' token
   14 |   else return x % 10 + func(x/10)
      |                                  ^
      |                                  ;
   15 | }
      | ~
Language: C++

#include <bits/stdc++.h>
#define fi first
#define se second
#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define sort(a) sort((a).begin(),(a).end())
#define rev(a) reverse((a).begin(),(a).end())
using db = double;
using namespace std;
typedef long long ll;


int main() {q
  int n;
  cin >> n;
  int num = n;
  int sum = 0;
  int digit;
  while(1) {
    digit = num % 10;
    num /= 10;
    sum += digit;
    if (num == 0) break;
  }
  if (n % sum == 0) cout << "Yes" << endl;
  else cout << "No" << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:13: error: 'q' was not declared in this scope
   13 | int main() {q
      |             ^
a.cc:15:10: error: 'n' was not declared in this scope; did you mean 'yn'?
   15 |   cin >> n;
      |          ^
      |          yn
Language: C++

#include <iostream>
#include <math.h>
#include <string>
#include <string.h>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <stdlib.h>
#include <deque>  
#include <iomanip>

using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:21:15: error: invalid operands of types 'double' and '__gnu_cxx::__promote<double>::__type' {aka 'double'} to binary 'operator%'
   21 |         S=S+(S%pow(10,i))/pow(10,i-1);
      |              ~^~~~~~~~~~
      |              |    |
      |              |    __gnu_cxx::__promote<double>::__type {aka double}
      |              double
a.cc:23:9: error: invalid operands of types 'double' and 'double' to binary 'operator%'
   23 |     if(N%S==0)cout<<"Yes"<<endl;
      |        ~^~
      |        | |
      |        | double
      |        double
Language: C++

#include<iostream>
#include<string>
#include<cmath>
#include<algorithm>

using namespace std;

int main(){
	string s;
	int a = 0;

	cin >> s;


	for (int i = 0; i < 4; i++){
		if (s[i] == "+"){
			a++;
		}
		if (s[i] == "-"){
			a--;
		
	}
		cout << a << endl;
		return 0;
	}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:26: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   16 |                 if (s[i] == "+"){
a.cc:19:26: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   19 |                 if (s[i] == "-"){
a.cc:25:10: error: expected '}' at end of input
   25 |         }
      |          ^
a.cc:8:11: note: to match this '{'
    8 | int main(){
      |           ^
Language: C++

#include <iostream>
#include <vector>
#include <cstring>



#define REP(i, n) for (long long i = 0; i < (n); i++) 
#define ll long long

using namespace std;

int main(){
    string S;
    cin >> S;
    ll res = 0;

    REP(i,S.size())
    {
        res += atoi(S[i]);

    }

    cout << res << endl;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:19:20: error: invalid conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const char*' [-fpermissive]
   19 |         res += 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<bits/stdc++.h>
using namespace std;

int main(){
  int N, S, A;
  cin >> N;
  A = N;

  while( N > 0){
    S += N % 10;
    N /= 10; 
  }
  if( A / S = 0)  cout << "yes" << endl;
  else  cout << "No" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:9: error: lvalue required as left operand of assignment
   13 |   if( A / S = 0)  cout << "yes" << endl;
      |       ~~^~~
Language: C++

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

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

  for( int i = 0; i < 10; i++){
    S += N * (i + 1) *10 / 1000000000
  }
  if(N % S = 0) cout << "Yes" << endl;
  else cout << "No" << endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:9:38: error: expected ';' before '}' token
    9 |     S += N * (i + 1) *10 / 1000000000
      |                                      ^
      |                                      ;
   10 |   }
      |   ~                                   
a.cc:11:8: error: lvalue required as left operand of assignment
   11 |   if(N % S = 0) cout << "Yes" << endl;
      |      ~~^~~
a.cc:12:29: error: expected '}' at end of input
   12 |   else cout << "No" << endl;
      |                             ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include <iostream>
using namespace std;
int digitsum(long a){
  int p = 0;
  while(a>0){
    p+=a%10:
    a/=10;
  }
  return p;
}
int main(){
  long a;
  cin >> a;
  if(a%digitsum(a) == 0){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
}

Compiler output:
a.cc: In function 'int digitsum(long int)':
a.cc:6:12: error: expected ';' before ':' token
    6 |     p+=a%10:
      |            ^
      |            ;