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

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

int main() {
    string s;
    int num = 0;
    cin >> s;

    for(i = 0; i < 3; i++) {
        if(s[i] == '+') {
            num += 1;
        }
        else {
            num -= 1;
        }
    }

    cout << num << endl;
}

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

#include<stdio>
int main()
{
    char a[4];
    int n=0;,i
    scanf("%s",&s);
    for(i=0;i<4;i++)
    {
          if(a[i]=='+')
          {
               n++;
          }
          else
          {
              n--;    
          }
    }           
    printf("%d",n);
    return 0;   
} 

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

#include <stdio.h>

int main(void){
	char[4] s;
  	int i = 0;
  	int k = 0;
  	for(i = 0; i < 4; i++)
      scanf("%c"&s[i]);
  	i = 0;
  	while(i < 4){
      if(s[i] == '+')
        k = k + 1;
      else if(s[i] == '-')
        k = k - 1;
      else
        
      i++;
}
  	printf("%d",k);
  	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:4:13: error: expected identifier or '(' before '[' token
    4 |         char[4] s;
      |             ^
main.c:8:18: error: 's' undeclared (first use in this function)
    8 |       scanf("%c"&s[i]);
      |                  ^
main.c:8:18: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

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

int main(){
char S[4];
int x = 0;
for(int i = 0;I<4;i++){
cin >> S[i];
}
for(int i = 0; i<4;i++)
{
if(S[i]=="+")x++;
else x--;
}
cout << x << endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:15: error: 'I' was not declared in this scope
    8 | for(int i = 0;I<4;i++){
      |               ^
a.cc:13:8: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   13 | if(S[i]=="+")x++;
      |    ~~~~^~~~~
Language: C

#include<stdio.h>
int main(){
int ans=0;
while(scanf(" %c", &c)!=EOF){
    if(c=="+") ans++;
    else ans--;
  }
printf("%d",ans);
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:4:21: error: 'c' undeclared (first use in this function)
    4 | while(scanf(" %c", &c)!=EOF){
      |                     ^
main.c:4:21: note: each undeclared identifier is reported only once for each function it appears in
Language: C++


#include <cstdio>
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <algorithm>
using namespace std;

int main()
{
    char str[5];
    while(gets(str)!=NULL)
    {
        int res=0;
        for(int i=0;str[i]!='\0';i++)
        {
            if(str[i]=='-')
                res--;
            else if(str[i]=='+')
                res++;
        }
        printf("%d\n",res);
    }
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:11: error: 'gets' was not declared in this scope; did you mean 'getw'?
   12 |     while(gets(str)!=NULL)
      |           ^~~~
      |           getw
Language: C++

#include <iostream>
using namespace std;

int main() {
  char c
  int num = 0;
  for (int i = 0; i < 4; i++) {
    cin >> c;
    if (c == '-') {
      num--;
    } else if (c == '+') {
      num++;
    }
  }
  cout << num << endl;
  
  return 0;
}
  


Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: expected initializer before 'int'
    6 |   int num = 0;
      |   ^~~
a.cc:8:12: error: 'c' was not declared in this scope
    8 |     cin >> c;
      |            ^
a.cc:10:7: error: 'num' was not declared in this scope; did you mean 'enum'?
   10 |       num--;
      |       ^~~
      |       enum
a.cc:12:7: error: 'num' was not declared in this scope; did you mean 'enum'?
   12 |       num++;
      |       ^~~
      |       enum
a.cc:15:11: error: 'num' was not declared in this scope; did you mean 'enum'?
   15 |   cout << num << endl;
      |           ^~~
      |           enum
Language: C++

#include<iostream>
#include<vector>
using namepsace std;
int find(string str)
{
int num=0;
for(int i=0;i<str.length();i++)
{
if(str[i]=='+')
num++;
else if(str[i]=='-')
num--;
}
return num;
}
int main()
{
string str;
cin >> str;
cout << find(str);
return 0;
}

Compiler output:
a.cc:3:7: error: expected nested-name-specifier before 'namepsace'
    3 | using namepsace std;
      |       ^~~~~~~~~
a.cc:4:10: error: 'string' was not declared in this scope
    4 | int find(string str)
      |          ^~~~~~
a.cc:4:10: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
                 from /usr/include/c++/14/ios:40,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
In file included 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:
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc: In function 'int main()':
a.cc:18:1: error: 'string' was not declared in this scope
   18 | string str;
      | ^~~~~~
a.cc:18:1: note: suggested alternatives:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:19:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   19 | cin >> str;
      | ^~~
      | std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:19:8: error: 'str' was not declared in this scope; did you mean 'std'?
   19 | cin >> str;
      |        ^~~
      |        std
a.cc:20:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   20 | cout << find(str);
      | ^~~~
      | std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:20:13: error: 'find' cannot be used as a function
   20 | cout << find(str);
      |         ~~~~^~~~~
Language: C++

#include<stdio.h>
int main(void){
  int answer;
  int i;
  char s[10];
  scanf("%d",&s);
  for (i=0;1<4;i++){
    if s[i]=="+" answer++;
    if s[i]=="-" answer--;
  }
  printf("%d",answer);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:8: error: expected '(' before 's'
    8 |     if s[i]=="+" answer++;
      |        ^
      |        (
a.cc:9:8: error: expected '(' before 's'
    9 |     if s[i]=="-" answer--;
      |        ^
      |        (
Language: Java

public class ProblemA {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		int x = 0;
		for (int i = 0; i<4; i++){
			if ( args[0].charAt(i) == '+' ) x++;
		}
			
		System.out.println((x - 2)*2);
		
	}

}


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

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

int main(){
  String S;
  int cnt = 0;
  cin >> S;
  for(int i=0;i<4;i++){
    if(S[i]=='+')cnt++;
    if(S[i]=='-')cnt--;
  }
  cout << cnt << endl;
}

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

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

string s;
int t,n;
int main() {
	getline(cin,s);
	for(i=0;i<=s.length();i++){
		if(s[i]=='+')t++;
		else t--;
	}
	printf("%d",t);
	return 0;
}

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

#include <stdio.h>

int main{
	char[4] s;
  	int i = 0;
  	int k = 0;
  	for(i = 0; i < 4; i++)
      scanf("%c"&s[i]);
  	i = 0;
  	while(i < 4){
      if(s[i] == '+')
        k = k + 1;
      else if(s[i] == '-')
        k = k - 1;
      else
        
      i++;
}
  	printf("%d",k);
  	return 0;
}

Compiler output:
main.c:3:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
    3 | int main{
      |         ^
Language: Java

import java.io.BufferedReader;
import java.io.InputStreamReader;
 
public class Main {
 
	public static void main(String[] args) throws IOException {
		BufferedReader vd = new BufferedReader(new InputStreamReader(System.in));
		String[] s = vd.readLine().split("");
    	int sum=0;
  	  for(int i=0;i<4;++i){
 	     if(s[i=="+"])sum=sum+1;
 	     if(s[i=="="])sum=sum-1;
  	  }
    System.out.println(sum);

  }
}

Compiler output:
Main.java:6: error: cannot find symbol
	public static void main(String[] args) throws IOException {
	                                              ^
  symbol:   class IOException
  location: class Main
Main.java:11: error: bad operand types for binary operator '=='
 	     if(s[i=="+"])sum=sum+1;
 	           ^
  first type:  int
  second type: String
Main.java:11: error: incompatible types: String cannot be converted to boolean
 	     if(s[i=="+"])sum=sum+1;
 	         ^
Main.java:12: error: bad operand types for binary operator '=='
 	     if(s[i=="="])sum=sum-1;
 	           ^
  first type:  int
  second type: String
Main.java:12: error: incompatible types: String cannot be converted to boolean
 	     if(s[i=="="])sum=sum-1;
 	         ^
5 errors
Language: C++

main = do
    e <- getLine
    print $ f e 0

f [c] n    = if (c == '+') then n+1 else n-1
f (c:cs) n = if (c == '+') then f cs (n+1)
                           else f cs (n-1)


Compiler output:
a.cc:1:1: error: 'main' does not name a type
    1 | main = do
      | ^~~~
Language: C

#include <iostream>
#include <string>

using namespace std;

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

  int ans = 0;
  for (int i = 0; i < S.size(); i++) {
      if (S[i] == '+') ans++;
      else ans--;
  }
  cout<<ans<<endl;

  return 0;
}

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 <stdlib.h>
#include <string.h>
int main()
{
    char s[5];
    int i,a=0,b=0;
    gets(s);
    for(i=0;s[i];i++)
    {
        if(s[i]=='+')
            a++;
        else
            b++;
    }
    printf("%d\n",a-b);
    return 0;
}


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

#include <bits/stdc++.h>

using namespace std;
int main()
{
    char s[5];
    gets(s);
    int x=0;
    for(int i=0; s[i]; i++)
    {
        if(s[i]=='+')
            x++;
        else if(s[i]=='-')
            x--;
    }
    printf("%d\n",x);
    return 0;
}


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

public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		String str = in.next();
		int num = 0;
		for(int i=0;i<4;i++) {
			char nowChar = str.charAt(i);
			if(nowChar=='+') {
				num++;
			}else if(nowChar=='-') {
				num--;
			}
		}
		System.out.println(num);
	}

Compiler output:
Main.java:1: error: unnamed classes are a preview feature and are disabled by default.
public static void main(String[] args) {
              ^
  (use --enable-preview to enable unnamed classes)
1 error
Language: C++

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

int main(){
  String S;
  int cnt = 0;
  cin >> S;
  for(int i=0;i<4;i++){
    if(S[i]=='+')cnt++;
    if(S[i]=='-')cnt--;
  }
  cout << cnt << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'String' was not declared in this scope
    6 |   String S;
      |   ^~~~~~
a.cc:8:10: error: 'S' was not declared in this scope
    8 |   cin >> S;
      |          ^
Language: C++

#include "stdafx.h"
#include <iostream>
using namespace std;
#include <string>
int main()
{
	string s;
	cin >> s;
	int ans = 0;
	for (char& c : s) {
		ans += (c == '+');
		ans -= (c == '-');
	}

	cout << ans<<endl;



    return 0;
}



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

#encoding: utf-8

a=input()

count=0

for i in range(len(a)):
    if a[i]=="+":
        count+=1
    else:
        count-=1
print(count)

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

#include<cstdio>
#include<cstring>
using namespace std;
char s[10];
int main(){
	gets(s);
	int ans=0;
	for (int i=0;i<strlen(s);i++) 
	if (s[i]=='+') ans++;else ans--;
	printf("%d",ans);
} 

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(s);
      |         ^~~~
      |         getw
Language: C

#include<stdio.h>
#include<math.h>
int main(){
  char a[4];
  int i,ans = 0;
  for (=0;i<4;i++){
    scanf("%c",a[i]);
    if(a[i]=='+') ans++;
    if(a[i]=='-') ans--;
  }
  printf("%d",ans);
  return 0;
  
}

Compiler output:
main.c: In function 'main':
main.c:6:8: error: expected expression before '=' token
    6 |   for (=0;i<4;i++){
      |        ^
Language: C++

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

int main(){
char S[4];
int x = 0;
cin >> S;
for(int i = 0; i<4;i++)
{
if(S[I]=="+")x++;
else x--;
}
cout << x << endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:6: error: 'I' was not declared in this scope
   11 | if(S[I]=="+")x++;
      |      ^
Language: Java

import java.util.Scanner;

public class Prob1
{

	public static void main(String[] args)
	{
		int n = 0;

		Scanner s = new Scanner(System.in);
		
		String l = s.nextLine();
		
		for (int i = 0; i < 4; i++)
		{
			n = l.charAt(i) == '+' ? n + 1 : n - 1;
		}
		System.out.println(n);
	}
}


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

#include<iostream>
using namespace std;
int main(){
  char a[4];
  int x=0;
  for(int i=1;i<=4;i++){
    cin>>a[i];
    if(a[i]=="+")x++;
    else x--;
  }
  cout<<x;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    8 |     if(a[i]=="+")x++;
      |        ~~~~^~~~~
Language: Java

import java.io.BufferedReader;
import java.io.InputStreamReader;
 
public class Main {
 
	public static void main(String[] args) throws Throwable {
		BufferedReader vd = new BufferedReader(new InputStreamReader(System.in));
		String[] s = vd.readLine().split("");
    int sum=0;
    for(int i=0;i<4;++i){
      if(s[i="+"])sum=sum+1;
      if(s[i="="])sum=sum-1;
    }
    System.out.println(sum);

  }
}

Compiler output:
Main.java:11: error: incompatible types: String cannot be converted to int
      if(s[i="+"])sum=sum+1;
             ^
Main.java:11: error: incompatible types: String cannot be converted to boolean
      if(s[i="+"])sum=sum+1;
          ^
Main.java:12: error: incompatible types: String cannot be converted to int
      if(s[i="="])sum=sum-1;
             ^
Main.java:12: error: incompatible types: String cannot be converted to boolean
      if(s[i="="])sum=sum-1;
          ^
4 errors
Language: C++

using System;

namespace AtTest
{
    class Program
    {
        static void Main(string[] args)
        {
            string input = Console.ReadLine();
            int number = 0;
            for (int i = 0; i < input.Length; i++)
            {
                if (input[i] == '+')
                {
                    number++;
                }
                else
                {
                    number--;
                }
            }

            Console.WriteLine(number);
        }
    }
}


Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:7:26: error: 'string' has not been declared
    7 |         static void Main(string[] args)
      |                          ^~~~~~
a.cc:7:35: error: expected ',' or '...' before 'args'
    7 |         static void Main(string[] args)
      |                                   ^~~~
a.cc:25:6: error: expected ';' after class definition
   25 |     }
      |      ^
      |      ;
a.cc: In static member function 'static void AtTest::Program::Main(int*)':
a.cc:9:13: error: 'string' was not declared in this scope
    9 |             string input = Console.ReadLine();
      |             ^~~~~~
a.cc:11:33: error: 'input' was not declared in this scope; did you mean 'int'?
   11 |             for (int i = 0; i < input.Length; i++)
      |                                 ^~~~~
      |                                 int
a.cc:23:13: error: 'Console' was not declared in this scope
   23 |             Console.WriteLine(number);
      |             ^~~~~~~
Language: C++

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

string s;
int t,n;
int main() {
	getline(cin,s);
	for(i=0;i<=s.lenngth();i++){
		if(s[i]=='+')t++;
		else t--;
	}
	printf("%d",t);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:13: error: 'i' was not declared in this scope
    8 |         for(i=0;i<=s.lenngth();i++){
      |             ^
a.cc:8:22: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'lenngth'; did you mean 'length'?
    8 |         for(i=0;i<=s.lenngth();i++){
      |                      ^~~~~~~
      |                      length
Language: C++

#include <stdio.h>
int main()
{
	int takahashi;
	takahashi = 0;
	char idea[4];
	scanf ("%s",idea);
	for (i=0; i<4; i++){
		if (idea[i] == "+"){
			takahashi += 1;
		}
		else if (idea[i] == "-"){
			takahashi -= 1;
		}
	}
	printf ("%d\n", takahashi);
	return 0;
}

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

#include<stdio.h>
#include<math.h>
int main(){
  char a[4];
  int i,ans = 0;
  for (=0;i<4;i++){
    scanf("%c",a[i]);
    if(a[i]=='+') sum++;
    if(a[i]=='-') sum--;
  }
  printf("%d",sum);
  return 0;
  
}

Compiler output:
main.c: In function 'main':
main.c:6:8: error: expected expression before '=' token
    6 |   for (=0;i<4;i++){
      |        ^
main.c:8:19: error: 'sum' undeclared (first use in this function)
    8 |     if(a[i]=='+') sum++;
      |                   ^~~
main.c:8:19: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <bits/stdc++.h>

using namespace std;
int main()
{
    char s[5];
    while(gets(s)!=NULL)
    {
        int x=0;
        for(int i=0;s[i];i++)
        {
            if(s[i]=='+')
                x++;
            else if(s[i]=='-')
                x--;
        }
        printf("%d\n",x);
    }

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:11: error: 'gets' was not declared in this scope; did you mean 'getw'?
    7 |     while(gets(s)!=NULL)
      |           ^~~~
      |           getw
Language: C

#include <iostream>
#include <string>

using namespace std;

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

  int ans = 0;
  for (int i = 0; i < S.size(); i++) {
      if (S[i] == '+') ans++;
      else ans--;
  }
  cout<<ans<<endl;

  return 0;
}



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

int ans=0;
while(scanf(" %c", &c)!=EOF){
    if(c=="+") ans++;
    else ans--;
  }
printf("%d",ans);

Compiler output:
main.c:2:1: error: expected identifier or '(' before 'while'
    2 | while(scanf(" %c", &c)!=EOF){
      | ^~~~~
main.c:6:8: error: expected declaration specifiers or '...' before string constant
    6 | printf("%d",ans);
      |        ^~~~
main.c:6:13: error: expected declaration specifiers or '...' before 'ans'
    6 | printf("%d",ans);
      |             ^~~
Language: Java

public static void main(String[] args) {
		String str = args[0];
		int num = 0;
		for(int i=0;i<4;i++) {
			char nowChar = str.charAt(i);
			if(nowChar=='+') {
				num++;
			}else if(nowChar=='-') {
				num--;
			}
		}
		System.out.println(num);
	}

Compiler output:
Main.java:1: error: unnamed classes are a preview feature and are disabled by default.
public static void main(String[] args) {
              ^
  (use --enable-preview to enable unnamed classes)
1 error
Language: C++

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:21: 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 '()' ?)
    7 |     for(int i=0;i<s.size;i++){
      |                   ~~^~~~
      |                         ()
Language: C++

#include<stdio.h>
int main(void)
{
	int S=0;
	int a, b, c, d;

	scanf("%d%d%d%d", a, b, c, d);

	if (a = +) {
		S++;
	}
	else {
		S--;
	}
	if (b= +) {
		S++;
	}
	else {
		S--;
	}

	if (c = +) {
		S++;
	}
	else {
		S--;
	}

	if (d = +) {
		S++;
	}
	else {
		S--;
	}
	printf("%d", &S);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:18: error: expected primary-expression before ')' token
    9 |         if (a = +) {
      |                  ^
a.cc:15:17: error: expected primary-expression before ')' token
   15 |         if (b= +) {
      |                 ^
a.cc:22:18: error: expected primary-expression before ')' token
   22 |         if (c = +) {
      |                  ^
a.cc:29:18: error: expected primary-expression before ')' token
   29 |         if (d = +) {
      |                  ^
Language: C++

using System;
using static System.Console;
using static System.Math;
using System.Linq;

class Program
{

    static void Main()
    {
        string input = ReadLine();
        int res = 0;
        for(int i = 0;i<input.Length;i++)
        {
            if (input[i] == '+')
            {
                res++;
            }
            else { res--; }
        }
        WriteLine(res);
    }
}


Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:2:7: error: expected nested-name-specifier before 'static'
    2 | using static System.Console;
      |       ^~~~~~
a.cc:3:7: error: expected nested-name-specifier before 'static'
    3 | using static System.Math;
      |       ^~~~~~
a.cc:4:7: error: expected nested-name-specifier before 'System'
    4 | using System.Linq;
      |       ^~~~~~
a.cc:23:2: error: expected ';' after class definition
   23 | }
      |  ^
      |  ;
a.cc: In static member function 'static void Program::Main()':
a.cc:11:9: error: 'string' was not declared in this scope
   11 |         string input = ReadLine();
      |         ^~~~~~
a.cc:13:25: error: 'input' was not declared in this scope; did you mean 'int'?
   13 |         for(int i = 0;i<input.Length;i++)
      |                         ^~~~~
      |                         int
a.cc:21:9: error: 'WriteLine' was not declared in this scope
   21 |         WriteLine(res);
      |         ^~~~~~~~~
Language: C++

#include<stdio.h>
int main(void)
{
	int S=0;
	int a, b, c, d;

	scanf("%d%d%d%d", a, b, c, d);

	if (a = +) {
		S++;
	}
	else {
		S--;
	}
	if (b= +) {
		S++;
	}
	else {
		S--;
	}

	if (c = +) {
		S++;
	}
	else {
		S--;
	}

	if (d = +) {
		S++;
	}
	else {
		S--;
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:18: error: expected primary-expression before ')' token
    9 |         if (a = +) {
      |                  ^
a.cc:15:17: error: expected primary-expression before ')' token
   15 |         if (b= +) {
      |                 ^
a.cc:22:18: error: expected primary-expression before ')' token
   22 |         if (c = +) {
      |                  ^
a.cc:29:18: error: expected primary-expression before ')' token
   29 |         if (d = +) {
      |                  ^
Language: C++

#include<queue>
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
int ans;
char b;
int main()
{
	scanf("%c",&b);
	while (b!="")
	{
		if (b=="-") ans--;
		    else ans++;
		scanf("%c".&b);
	}
	printf("%d",ans);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |         while (b!="")
      |                ~^~~~
a.cc:14:22: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   14 |                 if (b=="-") ans--;
      |                     ~^~~~~
a.cc:16:28: error: expected unqualified-id before '&' token
   16 |                 scanf("%c".&b);
      |                            ^
Language: C++

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

int main() {
    char s;
    int res = 0;
    for(i=0; i<4; i++){
      cin >> s;
      if(a=='+') res++;
      else res--;
    }
    cout << res << endl;
}

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

#include <stdio.h>
int main()
{
	int takahashi;
	tkahashi = 0;
	char idea[4];
	scanf ("%s",idea);
	for (i=0; i<4; i++){
		if (idea[i] == "+"){
			takahashi += 1;
		}
		else if (idea[i] == "-"){
			takahashi -= 1;
		}
	}
	printf ("%d\n", takahashi);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: 'tkahashi' was not declared in this scope; did you mean 'takahashi'?
    5 |         tkahashi = 0;
      |         ^~~~~~~~
      |         takahashi
a.cc:8:14: error: 'i' was not declared in this scope
    8 |         for (i=0; i<4; i++){
      |              ^
Language: C++

s = int(input())
n = 0
if s[0] = "+":
    n + 1
else:
    n - 1
if s[1] = "+":
    n + 1
else:
    n - 1
if s[2] = "+":
    n + 1
else:
    n - 1
if s[3] = "+":
    n + 1
else:
    n - 1

Compiler output:
a.cc:1:1: error: 's' does not name a type
    1 | s = int(input())
      | ^
Language: C++

#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<algorithm>
using namespace std;
char a[100001];
int c;
int main()
{
	gets(a);
	int str=strlen(a);
	for(int i=0;i<str;i++)
	{
		if(a[i]=='+')c++;
		else c--;
	}
	cout<<c;
	return 0;
}

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

int main() {
	char in;
	int ans = 0;
	for (int i = 0; i < 4; i++) {
		cin >> in;
		if (in == '+')ans++;
		else ans--;
	}
	cout << ans << "\n";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:17: error: 'cin' was not declared in this scope; did you mean 'in'?
    5 |                 cin >> in;
      |                 ^~~
      |                 in
a.cc:9:9: error: 'cout' was not declared in this scope
    9 |         cout << ans << "\n";
      |         ^~~~
Language: C++

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

using namespace std;

int main()
{
	string S;
	cin >> S;
	
	int ans = 0
	for (int i = 0; i < 4; i++)
	{
		if (S[i] == '+')
			ans++;
		else
			ans--;
	}

	cout << ans << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:9: error: expected ',' or ';' before 'for'
   15 |         for (int i = 0; i < 4; i++)
      |         ^~~
a.cc:15:25: error: 'i' was not declared in this scope
   15 |         for (int i = 0; i < 4; i++)
      |                         ^
Language: C++

#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<algorithm>
using namespace std;
char a[100001];
int c;
int main()
{
	gets(a);
	int str=strlen(a);
	for(int i=0;i<str;i++)
	{
		if(a[i]=='+')c++;
		if(a[i]=='-')c--;
	}
	cout<<c;
	return 0;
}

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

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

typedef long long ll;

int main()
{
    int ans=0;
    string s;
    cin>>s;
    rep(i,4){
        if(s[i]=='+')ans++
        else ans--;
    }
    cout << ans << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:27: error: expected ';' before 'else'
   14 |         if(s[i]=='+')ans++
      |                           ^
      |                           ;
   15 |         else ans--;
      |         ~~~~
Language: Java

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = 0;
		String S = sc.next();
		for(int i=0;i<S.length();i++) {
			switch(S.charAt(i)){
				case '+':
					N++;
					break;
				case '-':
					N--;
					break;
				default:
						
			}
		}
		System.out.println(N);
	}

Compiler output:
Main.java:21: error: reached end of file while parsing
	}
	 ^
1 error
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
	string s;
	cin>>s;
	int a=0,b=0;
	for (i=0;i<s.length();i++)
	{
		if (s[i]=='+')
		a++;
		else
		b++;
	}
	cout<<a-b;
}

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

/*
ID: richard124
PROB: kimbits
LANG: C++11
*/


#include <iostream>
#include <fstream>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <string>
#include <chrono>
#include <algorithm>
#include <bitset>

using namespace std;
using namespace std::chrono;

typedef pair<int, int> pii;
#define pb push_back;

string s;
int ans = 0;

int main() {
	high_resolution_clock::time_point t1 = high_resolution_clock::now();
	
	fin >> s;
	for (int i=0; i<4; i++) {
     if (s[i] == '+') {
      ans++; 
     }
      else {
       ans--; 
      }
    }
	cout << ans;

	
	high_resolution_clock::time_point t2 = high_resolution_clock::now();
	auto duration = duration_cast<nanoseconds>(t2-t1).count()/1000000000.0;
	cout << endl << "Execution time: " << duration << " seconds" << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:9: error: 'fin' was not declared in this scope
   31 |         fin >> s;
      |         ^~~
Language: C

#include <iostream>
#include <vector>
#include <algorithm>
#include <string>

using namespace std;

typedef long long ll;

int main()
{
	string S;
	cin >> S;
	int ans = 0;
	for(int i = 0; i < S.size(); i++) {
		if(S[i] == '+') ans++;
		else ans--;
	}
	cout << ans << endl;
	return 0;
}


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

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

#define PB push_back
#define EB emplace_back
#define MP make_pair
#define F first
#define S second
#define MSET(m,v) memset((m),(v),sizeof(m))
#define UB(c,v) (upper_bound((c).begin(),(c).end(),(v)))
#define LB(c,v) (lower_bound((c).begin(),(c).end(),(v)))
#define INREP int TC;cin>>TC;while(TC--)
#define CPPIO ios::sync_with_stdio(false);cin.tie(NULL);
#define PC(x) fixed<<setprecision(x)
#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << " : " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1<<" | ";
  __f(comma+1, args...);
}
#else
#define trace(...)
#endif

typedef long long ll;
typedef long double ld;
typedef vector <int> vi;
typedef vector <ll> vll;
typedef pair <int,int> pii;
typedef pair <ll,ll> pll;
typedef vector <pii> vpii;
typedef vector <pll> vpll;

// SOLUTION

int main () {
	CPPIO;
  int val = 0;
  string s;
  cin >> s;
  for (int i = 0; s[i]; i++) {
    if (s[i] == '+') val++;
    else val--;
  }
  cout << val;``
	return 0;
}


Compiler output:
a.cc:52:15: error: stray '`' in program
   52 |   cout << val;``
      |               ^
a.cc:52:16: error: stray '`' in program
   52 |   cout << val;``
      |                ^
Language: C++

#include <bits/stdc++.h>

#define INF 1000000021
#define MOD 1000000007
#define pb push_back
#define pp pop_back
#define pf push_front
#define sqr(a) (a)*(a)
#define mpr(a,b) make_pair(a, b)
#define all(x) (x.begin(), x.end())
#define deb(x) cerr << #x << " = " << x << '\n'
#define N 222222

using namespace std;

typedef long double ld;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef map<int, int> mpii;
typedef map<string, int> mpsi;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef queue<int> qi;
typedef queue<ll> qll;
typedef queue<pair<int, int>> qpi;
typedef priority_queue<int> pqi;
typedef priority_queue<ll> pqll;
typedef priority_queue<pair<int,int>> pqpi;

const ld pi = 2 * acos(0.0);
template<class T> bool umin(T& a, T b){if(a>b){a=b;return 1;}return 0;}
template<class T> bool umax(T& a, T b){if(a<b){a=b;return 1;}return 0;}
template<class T> T gcd(T a, T b){return b ? gcd(b, a % b) : a;}
template<class T> T lcm(T a, T b){return a*(b/gcd(a,b));}
template<class T, class TT>bool pal(T a, TT n){int k=0;for(int i=0;i<=n/2;i++){if(a[i]!=a[n-i-1]){k=1;break;}}return k?0:1;}

//int month[] = {0, 31, 28, 31, 30, 31,30, 31, 31, 30, 31, 30, 31};

int main()
{


	string s;
	cin >> s;
	int a = 0;
	for(int i = 0 ;i < s.size(); i ++)
	{
		if(s[i] == '+')
			ans ++;
		else
			ans --;
	}
	cout << ans;
	
	getchar();
	getchar();
	return 0;
	//freopen("Ganiyev.txt", "r", stdin);
	//freopen("Asadullo.txt", "w", stdout);
	//ios::sync_with_stdio(0);
	//cin.tie(0);cout.tie(0);
	
	
	
	
	
	
	
	
	
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:50:25: error: 'ans' was not declared in this scope; did you mean 'abs'?
   50 |                         ans ++;
      |                         ^~~
      |                         abs
a.cc:52:25: error: 'ans' was not declared in this scope; did you mean 'abs'?
   52 |                         ans --;
      |                         ^~~
      |                         abs
a.cc:54:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   54 |         cout << ans;
      |                 ^~~
      |                 abs
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll=long long;
int main() {
  int a;
  string b;
  cin>>b;
  a=stoi(b);
  ll c=b.size();
  ll d=0;
  for(ll i=0;i<c;i++){
    int e=b.at(i)-'0';
    d+=e;
  }
  if(a%e==0){
    cout<<"Yes"<<endl;
  }
  else{
    cout<<"No"<<endl;
  }
  
  return 0;
}


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

#include <bits/stdc++.h>
using namespace std;
using ll=long long;
int main() {
  int a;
  string b;
  cin>>b;
  a=stoi(b);
  ll c=a.size();
  ll d=0;
  for(ll i=0;i<c;i++){
    int e=a.at(i)-'0';
    d+=e;
  }
  if(a%e==0){
    cout<<"Yes"<<endl;
  }
  else{
    cout<<"No"<<endl;
  }
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:10: error: request for member 'size' in 'a', which is of non-class type 'int'
    9 |   ll c=a.size();
      |          ^~~~
a.cc:12:13: error: request for member 'at' in 'a', which is of non-class type 'int'
   12 |     int e=a.at(i)-'0';
      |             ^~
a.cc:15:8: error: 'e' was not declared in this scope
   15 |   if(a%e==0){
      |        ^
Language: C

#include <ctype.h>
#include <math.h>
#include <stack>
#include <string>
#include <string.h>
using namespace std;
double PI = 3.1415926535897932;
long mod = 1000000007;
 
const long INF = (1<<30);
 
int loop(int n) {
  int sum = 0;
  while(n != 0) {
    sum += n%10;
    n /= 10;
  }
  return sum;
}
 
int main() {
  int n;
  cin >> n;
  int sum = loop(n);
  
  if(n % sum == 0)
    cout << "Yes" << endl;
  else cout << "No" << endl;
}

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

#include <ctype.h>
#include <math.h>
#include <stack>
#include <string>
#include <string.h>
using namespace std;
double PI = 3.1415926535897932;
long mod = 1000000007;
 
const long INF = (1<<30);
 
int loop(int n) {
  int sum = 0;
  while(n != 0) {
    sum += n%10;
    n /= 10;
  }
  return sum;
}
 
int main() {
  int n;
  cin >> n;
  int sum = loop(n);
  
  if(n % sum == 0)
    cout << "Yes" << endl;
  else cout << "No" << endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:3: error: 'cin' was not declared in this scope
   23 |   cin >> n;
      |   ^~~
a.cc:6:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    5 | #include <string.h>
  +++ |+#include <iostream>
    6 | using namespace std;
a.cc:27:5: error: 'cout' was not declared in this scope
   27 |     cout << "Yes" << endl;
      |     ^~~~
a.cc:27:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:27:22: error: 'endl' was not declared in this scope
   27 |     cout << "Yes" << endl;
      |                      ^~~~
a.cc:6:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    5 | #include <string.h>
  +++ |+#include <ostream>
    6 | using namespace std;
a.cc:28:8: error: 'cout' was not declared in this scope
   28 |   else cout << "No" << endl;
      |        ^~~~
a.cc:28:8: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:28:24: error: 'endl' was not declared in this scope
   28 |   else cout << "No" << endl;
      |                        ^~~~
a.cc:28:24: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: C++

#include<bits/stdc++.h>
#define int long long
using namespace std;
signed main(){
  int N;
  cin>>N;
  int sum=0;
  for(int i=N;i>0;i/=10)sum+=i%10;
  cout<<(N%i?"No":"Yes")<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:12: error: 'i' was not declared in this scope
    9 |   cout<<(N%i?"No":"Yes")<<endl;
      |            ^
Language: C

#include<iostream>
using namespace std;

#define print(x) cout << #x << '=' << x << endl


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

	int M= N, sum=0;
	while(M!=0)
	{
		sum += M%10;
		M=M/10;
	}
	// print(sum);
	if(N%sum==0)
		cout << "Yes\n";
	else 
		cout << "No\n";
   	return 0;
}



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

#include<iostream>
using namespace std;
int main(){
  int a;
  cin >> a;
  int sum = 0;
  while(a>0){
    sum += a%10;
    a /= 10;
  }
  if(a%sum) cout << "Yes";
  else cout << "Np"
}

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

#include<iostream>
using namespace std;
int main(){
  int a;
  cin >> a;
  int sum = 0;
  while(a>0){
    sum += a%10;
    a /= 10;
  }
  if(a/sum) cout << "Yes";
  else cout << "Np"
}

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

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

int main() 
{
	std::string s;
	std::cin >> s;
	int k = 0;

	for (int i = 0; i < s.size; i++) {
		k = k + s[i] - '0';
	}
	
	int j = stoi(s);
	if (j % k == 0) {
		std::cout << "Yes" << std::endl;
	}
	else {
		std::cout << "No" << std::endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:31: 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 |         for (int i = 0; i < s.size; i++) {
      |                             ~~^~~~
      |                                   ()
Language: C++

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

#define inf 1072114514
#define llinf 4154118101919364364
#define mod 1000000007
#define pi 3.1415926535897932384


int round(int a,int b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;} 
int gcd(int a,int b){int c;while(b!=0){c=a%b;a=b;b=c;}return a;}    //最大公約数
int lcm(int a,int b){int c=gcd(a,b);a/=c;return a*b;}     //最小公倍数
int nCr(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;} //コンビネーション
int nHr(int a,int b){return nCr(a+b-1,b);}       // 重複組み合わせ
int fact(int a){int i,r=1;for(i=1;i<=a;i++){r*=i;}return r;}  //階乗
int pow(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=a;}return r;} // a~bまでの階乗
int dsum(int x){int r=0;while(x){r+=(x%10);x/=10;}return r;}   //数字の各位の和
int dsumb(int x,int b){int r=0;while(x){r+=(x%b);x/=b;}return r;}  // b進数の各位の和？
int sankaku(int x){return ((1+x)*x)/2;} //三角数 xまでの和

//以下long long ver
long long llmax(long long a,long long b){if(a>b){return a;}return b;}
long long llmin(long long a,long long b){if(a<b){return a;}return b;}
long long llzt(long long a,long long b){return llmax(a,b)-llmin(a,b);}
long long llround(long long a,long long b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
long long llceil(long long a,long long b){if(a%b==0){return a/b;}return (a/b)+1;}
long long llgcd(long long a,long long b){long long c;while(b!=0){c=a%b;a=b;b=c;}return a;}
long long lllcm(long long a,long long b){long long c=llgcd(a,b);a/=c;return a*b;}
long long llnCr(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;}
long long llnHr(long long a,long long b){return llnCr(a+b-1,b);}
long long llfact(long long a){long long i,r=1;for(i=1;i<=a;i++){r*=i;}return r;}
long long llpow(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=a;}return r;}
long long lldsum(long long x){long long r=0;while(x){r+=(x%10);x/=10;}return r;}
long long lldsumb(long long x,long long b){long long r=0;while(x){r+=(x%b);x/=b;}return r;}
long long llsankaku(long long x){return ((1+x)*x)/2;}

//double
double dbmax(double a,double b){if(a>b){return a;}return b;}
double dbmin(double a,double b){if(a<b){return a;}return b;}
double dbzt(double a,double b){return dbmax(a,b)-dbmin(a,b);}


typedef pair<int, int> ii;
typedef long long ll;
typedef vector<ll> vll;
typedef pair<ll,ll> pll;
#define forr(i,a,b) ; for(int i=(a); i<(b); i++)
#define clean(arr,val) memset(arr,val,sizeof(arr))
#define forn(i,n) forr(i,0,n)
#define PB push_back
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<pll> vpll;
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};

 
/*CODE START HERE*/
int main() {
  int n;
  cin >> n;
  int a = dsum(n);
  cout << (n%a = 0 ? "Yes": "No" ) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:63:13: error: lvalue required as left operand of assignment
   63 |   cout << (n%a = 0 ? "Yes": "No" ) << endl;
      |            ~^~
Language: C++

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

#define inf 1072114514
#define llinf 4154118101919364364
#define mod 1000000007
#define pi 3.1415926535897932384


int round(int a,int b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;} 
int gcd(int a,int b){int c;while(b!=0){c=a%b;a=b;b=c;}return a;}    //最大公約数
int lcm(int a,int b){int c=gcd(a,b);a/=c;return a*b;}     //最小公倍数
int nCr(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;} //コンビネーション
int nHr(int a,int b){return nCr(a+b-1,b);}       // 重複組み合わせ
int fact(int a){int i,r=1;for(i=1;i<=a;i++){r*=i;}return r;}  //階乗
int pow(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=a;}return r;} // a~bまでの階乗
int dsum(int x){int r=0;while(x){r+=(x%10);x/=10;}return r;}   //数字の各位の和
int dsumb(int x,int b){int r=0;while(x){r+=(x%b);x/=b;}return r;}  // b進数の各位の和？
int sankaku(int x){return ((1+x)*x)/2;} //三角数 xまでの和

//以下long long ver
long long llmax(long long a,long long b){if(a>b){return a;}return b;}
long long llmin(long long a,long long b){if(a<b){return a;}return b;}
long long llzt(long long a,long long b){return llmax(a,b)-llmin(a,b);}
long long llround(long long a,long long b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
long long llceil(long long a,long long b){if(a%b==0){return a/b;}return (a/b)+1;}
long long llgcd(long long a,long long b){long long c;while(b!=0){c=a%b;a=b;b=c;}return a;}
long long lllcm(long long a,long long b){long long c=llgcd(a,b);a/=c;return a*b;}
long long llnCr(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;}
long long llnHr(long long a,long long b){return llnCr(a+b-1,b);}
long long llfact(long long a){long long i,r=1;for(i=1;i<=a;i++){r*=i;}return r;}
long long llpow(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=a;}return r;}
long long lldsum(long long x){long long r=0;while(x){r+=(x%10);x/=10;}return r;}
long long lldsumb(long long x,long long b){long long r=0;while(x){r+=(x%b);x/=b;}return r;}
long long llsankaku(long long x){return ((1+x)*x)/2;}

//double
double dbmax(double a,double b){if(a>b){return a;}return b;}
double dbmin(double a,double b){if(a<b){return a;}return b;}
double dbzt(double a,double b){return dbmax(a,b)-dbmin(a,b);}


typedef pair<int, int> ii;
typedef long long ll;
typedef vector<ll> vll;
typedef pair<ll,ll> pll;
#define forr(i,a,b) ; for(int i=(a); i<(b); i++)
#define clean(arr,val) memset(arr,val,sizeof(arr))
#define forn(i,n) forr(i,0,n)
#define PB push_back
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<pll> vpll;
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};

 
/*CODE START HERE*/
int main() {
  int n;
  cin >> n;
  int a = dsum(n);
  cout << (n%a = 0 ? "Yes":"No") << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:63:13: error: lvalue required as left operand of assignment
   63 |   cout << (n%a = 0 ? "Yes":"No") << endl;
      |            ~^~