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

#include <iostream>
using namweapace std;

int main(){
  long long int a;
  cin>>a;
  if(a%9==0)
    cout<<"Yes";
  else
    cout<<"No";
    
}

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namweapace'
    2 | using namweapace std;
      |       ^~~~~~~~~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |   cin>>a;
      |   ^~~
      |   std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:8:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    8 |     cout<<"Yes";
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:10:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   10 |     cout<<"No";
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){ 
string s;
cin>>s ;
int sum=0; 
for(int i=0;i<=s.size();i++)
{
	sum+=s[i]-"0";
	
}
if(sum%9==0)
cout<<"YES";
else
cout<<"NO";
return 0; 
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:9:18: error: invalid operands of types '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} and 'const char [2]' to binary 'operator-'
    9 |         sum+=s[i]-"0";
Language: Java

import java.util.Scanner;

public class Solution {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		solve(s, s.length());
	}

	private static void solve(String s, int len) {
		// TODO Auto-generated method stub
		long sum = 0;
		for(int i = 0; i < len; i++) {
			sum += s.charAt(i) - '0';
		}
		if (sum % 9 == 0) 
			System.out.println("Yes");
		else 
			System.out.println("No");
	}

}


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

import java.util.Scanner;

public class MultipleOf9 {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		solve(s, s.length());
	}

	private static void solve(String s, int len) {
		// TODO Auto-generated method stub
		long sum = 0;
		for(int i = 0; i < len; i++) {
			sum += s.charAt(i) - '0';
		}
		if (sum % 9 == 0) 
			System.out.println("Yes");
		else 
			System.out.println("No");
	}

}


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

#include<bits/stdc++>
using namespace std;
int main(){
 string a[200010];
 int sum=0;
 cin >> a;
 for(int i=0;i<a.size();i++){
 	sum +=(int)a[i]
 }
 if(sum%9==0){cout<<"Yes"<<endl;}
 else{cout<<"No"<<edl;}
}

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

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

int main(){
    string num;

    cin >> num;

    int sum = 0;

    for(int i = 0; i < num.size(); i++) s_um += (num[i] - '0');

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

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:41: error: 's_um' was not declared in this scope; did you mean 'sum'?
   11 |     for(int i = 0; i < num.size(); i++) s_um += (num[i] - '0');
      |                                         ^~~~
      |                                         sum
Language: C

#include <stdio.h>
#include<math.h>
int main() 
{
    long n,sum=0;
    scanf("%ld",&n);
    if()
    if(n>=0&&n<pow(10,200000))
    {
        while(n!=0)
        {
            sum=sum+n%10;
            n=n/10;
        }
        if(sum%9==0)
        printf("Yes");
        else
        printf("No");
    }
	return 0;

}

Compiler output:
main.c: In function 'main':
main.c:7:8: error: expected expression before ')' token
    7 |     if()
      |        ^
Language: C++

#include <bits/stdc++.h>
 
using namespace std;
 
int main(){
  string s;
  cin >> s;
  int sum = 0;
  for(int i = 0; i < s.sz; i++){
    sum += s[i] - '0';
  }
  if(sum % 9 == 0){
    cout << "Yes";
  }
   else{
     cout << "No";
   }
 }

Compiler output:
a.cc: In function 'int main()':
a.cc:9:24: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'sz'; did you mean 'size'?
    9 |   for(int i = 0; i < s.sz; i++){
      |                        ^~
      |                        size
Language: C++

#include < bits/stdc++.h>
 
using namespace std;
 
int main(){
  string s;
  cin >> s;
  int sum = 0;
  for(int i = 0; i < s.sz; i++){
    sum += s[i] - '0';
  }
  if(sum % 9 == 0){
    cout << "Yes";
  }
   else{
     cout << "No";
   }
 }

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

#include < bits/stdc++.h>

using namespace std;

int main(){
  string s;
  cin >> s;
  int sum = 0;
  for(int i = 0; i < s.sz; i++){
    sum += s[i] - '0';
  }
  if(sum % 9 == 0){
    cout << "Yes";
   else{
     cout << "No";
   }
 }

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

#include <iostream.h>
using namespace std;

int main() 
{
    int n,sum=0;
    if(n>=0)
    {
        if(n%9==0)
        cout<<"yes";
        else
        cout<<"no";
    }
	return 0;
}

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

#include<bits/stdc++.h>
using namespace std;
#include <boost/multiprecision/cpp_int.hpp>

using namespace boost::multiprecision;
int main(){

	int512_t i,j,n,x,k=0;
    string s;
  	cin>>s;
  	
	  for(i=0;i<s.length();i++){
  		
		k += s[i]-48;
    	k = k%9;
  	}
  
  	if(k%9 == 0){
  		cout<<"YES";
	}
  
  	else{
  		cout<<"NO";
  	}
}

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

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

int main(){

	long long i,j,n,x,k=0;
    string s;
  cin>>s;
  for(i=0;i<s.length();i++){
  	k += s[i]-48
  }
  if(k%9 == 0){
  cout<<"YES";}
  else{
  	cout<<"NO"'
  }
}

Compiler output:
a.cc:15:19: warning: missing terminating ' character
   15 |         cout<<"NO"'
      |                   ^
a.cc:15:19: error: missing terminating ' character
a.cc: In function 'int main()':
a.cc:10:21: error: expected ';' before '}' token
   10 |         k += s[i]-48
      |                     ^
      |                     ;
   11 |   }
      |   ~                  
a.cc:15:19: error: expected ';' before '}' token
   15 |         cout<<"NO"'
      |                   ^
      |                   ;
   16 |   }
      |   ~
Language: C++

import java.util.Scanner;

public class Main{	
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int num = 0;
		for(int i=0;i<s.length();i++){
			try{
				num+=Integer.parseInt(s.substring(i,i+1));
			}catch(Exception e){}
			num%=9;
		}
		if(num==0)
			System.out.println("Yes");
		else
			System.out.println("No");
		sc.close();
	}
}

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

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


    int getsum(string n)
    {
    int sum = 0;
    for (i=0;i<n.size();i++)
    {
     sum = sum + n[i]-'0';
    }
    return sum;
    }


int main()

{
    string n;
    cin>>n;
    int p=getsum(n);

    
    else if(p%9)
    {
        cout<<"No"<<endl;
    }

    else cout<<"Yes"<<endl;




    }

Compiler output:
a.cc: In function 'int getsum(std::string)':
a.cc:8:10: error: 'i' was not declared in this scope
    8 |     for (i=0;i<n.size();i++)
      |          ^
a.cc: In function 'int main()':
a.cc:24:5: error: 'else' without a previous 'if'
   24 |     else if(p%9)
      |     ^~~~
Language: C

#include <stdio.h>
#define MAXSIZE 10000000000000000000

int main(void){
  int n;
  int a[MAXSIZE];

  scanf("%d", &n);
  int i = 0;
  while(n < 10){
    a[i] = n % 10;
    i++;
    n = n / 10;
  }

  int ans;
  for(int j = 0; j < i; j++){
    ans = ans + a[j];
  }
  if(ans % 9 == 0) printf("Yes\n");
  else printf("No\n");

  return 0;

  
}

Compiler output:
main.c: In function 'main':
main.c:6:9: warning: integer constant is so large that it is unsigned
    6 |   int a[MAXSIZE];
      |         ^~~~~~~
main.c:6:7: error: size of array 'a' is too large
    6 |   int a[MAXSIZE];
      |       ^
Language: C++

#include <stdio.h>
#include <cstring>
int main(){
  char N[200100];
  int sum;
  sum=0;
  scanf("%s",N);
  int len = strlen(N);
  for(int i=0;i<N;i++){
    sum += N[i]-'0';
  }
  if(sum%9==0){
    printf("Yes");
  }
  else{
    printf("No");
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 |   for(int i=0;i<N;i++){
      |               ~^~
Language: C++

#incude <stdio.h>
#include <cstring>
int main(){
  char N[200100];
  int sum;
  sum=0;
  scanf("%s",N);
  int len = strlen(N);
  for(int i=0;i<N;i++){
    sum += N[i]-'0';
  }
  if(sum%9==0){
    printf("Yes");
  }
  else{
    printf("No");
  }
}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #incude; did you mean #include?
    1 | #incude <stdio.h>
      |  ^~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:7:3: error: 'scanf' was not declared in this scope
    7 |   scanf("%s",N);
      |   ^~~~~
a.cc:9:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 |   for(int i=0;i<N;i++){
      |               ~^~
a.cc:13:5: error: 'printf' was not declared in this scope
   13 |     printf("Yes");
      |     ^~~~~~
a.cc:3:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
    2 | #include <cstring>
  +++ |+#include <cstdio>
    3 | int main(){
a.cc:16:5: error: 'printf' was not declared in this scope
   16 |     printf("No");
      |     ^~~~~~
a.cc:16:5: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
Language: C

#include <stdio.h>

int main(void){
  int n, i;
  int num = 1;
  scnaf("%d", &n);

  int tmp = n;
  while(tmp < 10){
    tmp / 10;
    num++;
  }
  int a[num];
  for(i = 0; i < num; i++){
    int b = n % 10;
    a[i] = b;
    n = n / 10;
  }

  int ans;
  for(i = 0; i < num; i++){
    ans = ans + a[i];
  }
  if(ans % 9 == 0) printf("Yes\n");
  else printf("No\n");

  return 0;
  
  
}

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

#include<stdio.h>

int main(){
  char N[200100];
  int sum;
  sum = 0;
  scanf("%s",N);
  int len = strlen(N);
  for(int i=0;i<len;i++){
    sum = sum + N[i] - "0";
  }
  if(sum % 9 == 0){
    printf("Yes");
  }
  else{
    printf("No");
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:13: error: 'strlen' was not declared in this scope
    8 |   int len = strlen(N);
      |             ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<stdio.h>
  +++ |+#include <cstring>
    2 | 
a.cc:10:22: error: invalid operands of types 'int' and 'const char [2]' to binary 'operator-'
   10 |     sum = sum + N[i] - "0";
      |           ~~~~~~~~~~ ^ ~~~
      |               |        |
      |               int      const char [2]
Language: C++

#include<stdio.h>

int main(){
  int N[200100];
  int sum;
  sum = 0;
  scanf("%s",N);
  int len = strlen(N);
  for(int i=0;i<len;i++){
    sum = sum + N[i] - "0";
  }
  if(sum % 9 == 0){
    printf("Yes");
  }
  else{
    printf("No");
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:13: error: 'strlen' was not declared in this scope
    8 |   int len = strlen(N);
      |             ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<stdio.h>
  +++ |+#include <cstring>
    2 | 
a.cc:10:22: error: invalid operands of types 'int' and 'const char [2]' to binary 'operator-'
   10 |     sum = sum + N[i] - "0";
      |           ~~~~~~~~~~ ^ ~~~
      |               |        |
      |               int      const char [2]
Language: C++

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

int main() {
	
	string s;
	cin>>s;
	long long sum = 0;
	
	for(int i = s.size()-1; i >= 0; i--)
	{
		sum+=long long(s[i])-48;
	}
	
	if(sum % 9 == 0)
	{
		cout<<"Yes";
	}
	else
	{
		cout<<"No";
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:22: error: expected primary-expression before 'long'
   13 |                 sum+=long long(s[i])-48;
      |                      ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
  string s;
  cin>>s; 
  int ans=0; 
  for (int i=0;s[i]!='\0';i++)
  {
    ans+=stoi(s[i]);
  }
  if (ans%9)
    cout<<'No';
  else
    cout<<'Yes'; 
  return 0;
}

Compiler output:
a.cc:13:11: warning: multi-character character constant [-Wmultichar]
   13 |     cout<<'No';
      |           ^~~~
a.cc:15:11: warning: multi-character character constant [-Wmultichar]
   15 |     cout<<'Yes';
      |           ^~~~~
a.cc: In function 'int main()':
a.cc:10:14: error: no matching function for call to 'stoi(__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type&)'
   10 |     ans+=stoi(s[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++

//B
#include<bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(v) v.begin(), v.end()

using namespace std;
typedef long long LL;

int main(){
	//mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
	string s;
	cin >> s;
	int cnt = 0;
	for (auto i : s) {
		cnt += (i - '0'); cnt %= 9;
	}
	if (cnt > 0) printf("No\n");
	else printf("Yes\n");

Compiler output:
a.cc: In function 'int main()':
a.cc:21:30: error: expected '}' at end of input
   21 |         else printf("Yes\n");
      |                              ^
a.cc:12:11: note: to match this '{'
   12 | int main(){
      |           ^
Language: C++

#include<stdio.h>
#include<string.h>
int main()
{
	int i,sm=0;
	char s[100000];
	scanf("%s",s);
	for(i=0;i<strlen(s);i++)
		{sm+=[i]-'0';sm%=9;}
		if(sm%9==0)
		printf("Yes\n");
		else
		printf("No\n");
}

Compiler output:
a.cc: In lambda function:
a.cc:9:25: error: expected '{' before '-' token
    9 |                 {sm+=[i]-'0';sm%=9;}
      |                         ^
a.cc: In function 'int main()':
a.cc:9:25: error: no match for 'operator-' (operand types are 'main()::<lambda()>' and 'char')
    9 |                 {sm+=[i]-'0';sm%=9;}
      |                      ~~~^~~~
      |                      |   |
      |                      |   char
      |                      main()::<lambda()>
Language: C++

#include<bits/stdc++.h>
#include<string>
using namespace std;
int main()
{
  string a;
  int sum=0,n;
    cin>>a;
  n=a.length;
  for(int i=0;i<n;i++)
  {
   sum=sum+( a[i]-'0');  
    sum=sum%9;
  }
  //cout<<sum<<endl;
if(sum==0)
  cout<<"YES"<<endl;
  else
    cout<<"NO"<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:7: error: cannot convert 'std::__cxx11::basic_string<char>::length' from type 'std::__cxx11::basic_string<char>::size_type (std::__cxx11::basic_string<char>::)() const noexcept' {aka 'long unsigned int (std::__cxx11::basic_string<char>::)() const noexcept'} to type 'int'
    9 |   n=a.length;
      |       ^~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
  string a;
  int sum=0,n;
    cin>>a;
  n=a.length;
  for(int i=0;i<n;i++)
  {
   sum=sum+( a[i]-'0');  
    sum=sum%9;
  }
  //cout<<sum<<endl;
if(sum==0)
  cout<<"YES"<<endl;
  else
    cout<<"NO"<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:7: error: cannot convert 'std::__cxx11::basic_string<char>::length' from type 'std::__cxx11::basic_string<char>::size_type (std::__cxx11::basic_string<char>::)() const noexcept' {aka 'long unsigned int (std::__cxx11::basic_string<char>::)() const noexcept'} to type 'int'
    8 |   n=a.length;
      |       ^~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
  string a;
  int sum=0,n;
    cin>>a;
  n=a.lenght();
  for(int i=0;i<n;i++)
  {
   sum=sum+( a[i]-'0');  
    sum=sum%9;
  }
  //cout<<sum<<endl;
if(sum==0)
  cout<<"YES"<<endl;
  else
    cout<<"NO"<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:7: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'lenght'; did you mean 'length'?
    8 |   n=a.lenght();
      |       ^~~~~~
      |       length
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
  string n;
	cin>>n;
	ll sum=0;
  ll size=s.length();
	for(ll i=0;i<size;i++)
    {
	sum+=(s[i]-'0');
      sum=sum%9;
    }
	if(sum%9==0)
	cout<<"Yes"<<"\n";
	else
	cout<<"No"<<"\n";
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:11: error: 's' was not declared in this scope
    8 |   ll size=s.length();
      |           ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
  string a;
  int sum=0;
    cin>>a;
  for(int i=0;i<a.lenght();i++)
  {
   sum=sum+( a[i]-'0');  
    sum=sum%9;
  }
  //cout<<sum<<endl;
if(sum==0)
  cout<<"YES"<<endl;
  else
    cout<<"NO"<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:19: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'lenght'; did you mean 'length'?
    8 |   for(int i=0;i<a.lenght();i++)
      |                   ^~~~~~
      |                   length
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
  string a;
  int sum=0;
    cin>>a;
  for(int i=0;i<int a.size();i++)
  {
   sum=sum+( a[i]-'0');  
    sum=sum%9;
  }
  //cout<<sum<<endl;
if(sum==0)
  cout<<"YES"<<endl;
  else
    cout<<"NO"<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:17: error: expected primary-expression before 'int'
    8 |   for(int i=0;i<int a.size();i++)
      |                 ^~~
a.cc:8:17: error: expected ';' before 'int'
    8 |   for(int i=0;i<int a.size();i++)
      |                 ^~~
      |                 ;
a.cc:8:17: error: expected primary-expression before 'int'
    8 |   for(int i=0;i<int a.size();i++)
      |                 ^~~
a.cc:8:17: error: expected ')' before 'int'
    8 |   for(int i=0;i<int a.size();i++)
      |      ~          ^~~
      |                 )
a.cc:8:22: error: expected initializer before '.' token
    8 |   for(int i=0;i<int a.size();i++)
      |                      ^
a.cc:8:30: error: 'i' was not declared in this scope
    8 |   for(int i=0;i<int a.size();i++)
      |                              ^
Language: C++

#include <iostream>
#include <string>
#include <sstream>
using namespace std;
int main(){
  string n;
  cin >> n;
  int num = 0;
  for(int i=0;i<(int)n.size();i++){
    num += stoi(n[i]);
  }
  if(num % 9 == 0){
    cout << "Yes";
  }else{
    cout << "No";
  }
  return 0;
}


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

#include <iostream>
#include <string>
using namespace std;
int main(){
  string n;
  cin >> n;
  int num = 0;
  for(int i=0;i<(int)n.size();i++){
    num += stoi(n[i]);
  }
  if(num % 9 == 0){
    cout << "Yes";
  }else{
    cout << "No";
  }
  return 0;
}


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

import java.util.*;
public class Main{   
public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt();
  		int b=0;
  		int sum =0;
  		while(a!=0)
        {
          a=a/10;
          b= a%10;
          sum+=b;
        }
        if(sum%9==0)
        {
            System.out.println("Yes");
        }else 
        {
            System.out.println("No");
        }
    }

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

#include <iostream>
#include <string>
using namespace std;
int main(){
  string n;
  cin >> n;
  int num = 0;
  for(int i=0;i<(int)n.size();i++){
    num += (int)n[i];
  }
  if(n % 9 == 0){
    cout << "Yes";
  }else{
    cout << "No";
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:8: error: no match for 'operator%' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
   11 |   if(n % 9 == 0){
      |      ~ ^ ~
      |      |   |
      |      |   int
      |      std::string {aka std::__cxx11::basic_string<char>}
Language: C++

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

int main() {
  vector<int> vec;
  int num;
  cin >> num;
  
  int sum = 0;
  for(int i = 0; i < num; i++) {
    cin >> vec.at(i);
    
    
    sum += vec.at(i);
    
    if(sum % 9 = 0) {
      cout << "Yes" << endl;
    }
    else {
      cout << "No" << endl;
    }
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:12: error: lvalue required as left operand of assignment
   16 |     if(sum % 9 = 0) {
      |        ~~~~^~~
Language: C++

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

int main() {
  vector<int> vec(N);
  
  int num = N.size();
  for(int i = 0; i < num; i++) {
    cin >> vec.at(i);
    
    int sum = 0;
    
    sum += vec.at(i);
    
    if(sum % 9 = 0) {
      cout << "Yes" << endl;
    }
    else {
      cout << "No" << endl;
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:19: error: 'N' was not declared in this scope
    5 |   vector<int> vec(N);
      |                   ^
a.cc:15:12: error: lvalue required as left operand of assignment
   15 |     if(sum % 9 = 0) {
      |        ~~~~^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  string s;
  cin >> s;
  long long sum = 0;
  for(int i = 0; i < s.length(); i++){
    sum += stoi(s[i]);
  }
  if(sum % 9 == 0) puts("Yes");
  else puts("No");
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:16: error: no matching function for call to 'stoi(__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type&)'
    8 |     sum += stoi(s[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>
#define ll long long
#define pb push_back
using namespace std;



int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    string n;
    cin>>n;
    long long sum = 0;
    for(int i=0;i<n.size();i++) ans+=n[i]-'0';
    if(ans%9==0) cout<<"Yes";
    else cout<<"No";
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:33: error: 'ans' was not declared in this scope; did you mean 'abs'?
   15 |     for(int i=0;i<n.size();i++) ans+=n[i]-'0';
      |                                 ^~~
      |                                 abs
a.cc:16:8: error: 'ans' was not declared in this scope; did you mean 'abs'?
   16 |     if(ans%9==0) cout<<"Yes";
      |        ^~~
      |        abs
Language: C++

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

signed main() {
	string s;
	cin>>s;
	int n = a.size();
	int sum = 0;
	rep(i,n){
		sum+=s[i] - '0';
	}
	if(sum%9==0) cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:17: error: 'a' was not declared in this scope
   10 |         int n = a.size();
      |                 ^
Language: C

#include <stdio.h>
​
int main(void){
    long long n = 0;
    int temp;
    
    while((temp = getchar()) != EOF){　/* EOF だと半分不正解だった */
        n += temp - '0';
    }
​
    if((n % 9) == 0){
        printf("Yes");
    } else {
        printf("No");
    }
    
    return 0;


Compiler output:
main.c:2:1: error: expected ';' before 'int'
    2 | ​
      | ^
      | ;
    3 | int main(void){
      | ~~~
main.c: In function 'main':
main.c:7:38: error: stray '\343' in program
    7 |     while((temp = getchar()) != EOF){<U+3000>/* EOF <U+3060><U+3068><U+534A><U+5206><U+4E0D><U+6B63><U+89E3><U+3060><U+3063><U+305F> */
      |                                      ^~~~~~~~
main.c:10:1: error: '\U0000200b' undeclared (first use in this function)
   10 | ​
      |  
main.c:10:1: note: each undeclared identifier is reported only once for each function it appears in
main.c:10:1: error: expected ';' before 'if'
   10 | ​
      | ^
      | ;
   11 |     if((n % 9) == 0){
      |     ~~
main.c:17:5: error: expected declaration or statement at end of input
   17 |     return 0;
      |     ^~~~~~
Language: C

#include <stdio.h>
​
int main(void){
    long long n = 0;
    int temp;
    
    while((temp = getchar()) != 'EOF'){　/* EOF だと半分不正解だった */
        n += temp - '0';
    }
​
    if((n % 9) == 0){
        printf("Yes");
    } else {
        printf("No");
    }
    
    return 0;


Compiler output:
main.c:2:1: error: expected ';' before 'int'
    2 | ​
      | ^
      | ;
    3 | int main(void){
      | ~~~
main.c: In function 'main':
main.c:7:33: warning: multi-character character constant [-Wmultichar]
    7 |     while((temp = getchar()) != 'EOF'){　/* EOF だと半分不正解だった */
      |                                 ^~~~~
main.c:7:40: error: stray '\343' in program
    7 |     while((temp = getchar()) != 'EOF'){<U+3000>/* EOF <U+3060><U+3068><U+534A><U+5206><U+4E0D><U+6B63><U+89E3><U+3060><U+3063><U+305F> */
      |                                        ^~~~~~~~
main.c:10:1: error: '\U0000200b' undeclared (first use in this function)
   10 | ​
      |  
main.c:10:1: note: each undeclared identifier is reported only once for each function it appears in
main.c:10:1: error: expected ';' before 'if'
   10 | ​
      | ^
      | ;
   11 |     if((n % 9) == 0){
      |     ~~
main.c:17:5: error: expected declaration or statement at end of input
   17 |     return 0;
      |     ^~~~~~
Language: C

#include <stdio.h>
​
int main(void){
    long long n = 0;
    int temp;
    
    while((temp = getchar()) != '\n'){　/* EOF だと半分不正解だった */
        n += temp - '0';
    }
​
    if((n % 9) == 0){
        printf("Yes");
    } else {
        printf("No");
    }
    
    return 0;


Compiler output:
main.c:2:1: error: expected ';' before 'int'
    2 | ​
      | ^
      | ;
    3 | int main(void){
      | ~~~
main.c: In function 'main':
main.c:7:39: error: stray '\343' in program
    7 |     while((temp = getchar()) != '\n'){<U+3000>/* EOF <U+3060><U+3068><U+534A><U+5206><U+4E0D><U+6B63><U+89E3><U+3060><U+3063><U+305F> */
      |                                       ^~~~~~~~
main.c:10:1: error: '\U0000200b' undeclared (first use in this function)
   10 | ​
      |  
main.c:10:1: note: each undeclared identifier is reported only once for each function it appears in
main.c:10:1: error: expected ';' before 'if'
   10 | ​
      | ^
      | ;
   11 |     if((n % 9) == 0){
      |     ~~
main.c:17:5: error: expected declaration or statement at end of input
   17 |     return 0;
      |     ^~~~~~
Language: C

        #include <bits/stdc++.h>
        #define ll long long
        #define ld long double
        #define pb push_back
        #define fi first
        #define se second
        #define end "\n"
        #define fast ios::sync_with_stdio(0),cin.tie(NULL),cout.tie(NULL);
        #define GCD(x,y)          (__gcd((x), (y)))
        #define LCM(x,y)          (((x)/__gcd((x), (y)))*(y))
        #define mem(x,y) memset(x,y,sizeof(x))
        using namespace std;
        long long n,i,t,j,l,y,k,r,a[301301],b[301000],k1,k2,ma,mi,sum, s1,in,jm,f,xx,cur,x,jj,ii,m,z,mia,mib,ans,sum1;
        string s,s2;
        double te;
        char c[101][101];
        long long power(long long x, unsigned long long y)
{
    if (y == 0)
        return 1;
    else if (y % 2 == 0)
        return power(x, y / 2) * power(x, y / 2);
    else
        return x * power(x, y / 2) * power(x, y / 2);
}
        map<long long ,long long>mr;
         map<long long ,long long>mc;

        int main()
        {

            fast;
           // cin>>t;
           // while(t--){
            cin>>s;
            for(i=0;i<s.size();i++)
                ans+=s[i]-'0';

            if(ans%9)cout<<"NO";
            else cout<<"YES";


        }









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

import java.util.*;
import java.io.*;
import java.math.BigInteger;

public class B {
    public static void main(String[] args) {
        MyScanner scn = new MyScanner();
        out = new PrintWriter(new BufferedOutputStream(System.out));

        // Start writing your solution here. -------------------------------------

        /*
         * int n = sc.nextInt(); // read input as integer long k = sc.nextLong(); //
         * read input as long double d = sc.nextDouble(); // read input as double String
         * str = sc.next(); // read input as String String s = sc.nextLine(); // read
         * whole line as String
         * 
         * int result = 3*n; out.println(result); // print via PrintWriter
         */

        // Stop writing your solution here. -------------------------------------
        String s = scn.next();
        // BigInteger input = new BigInteger(s);
        BigInteger ans = new BigInteger("0");

        for (int i = 0; i < s.length(); i++) {
            int val = s.charAt(i) - '0';
            ans = ans.add(BigInteger.valueOf(val));
        }
        out.println(ans.mod(BigInteger.valueOf(9)) == BigInteger.valueOf(0) ? "Yes" : "No");

        out.close();
    }

    public static PrintWriter out;

    public static class MyScanner {
        BufferedReader br;
        StringTokenizer st;

        public MyScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

    }

}

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

//author: JainBot27
//Created on: 08/22/20
#pragma GCC optimize("Ofast")
#pragma GCC target("sse4,avx,avx2,fma")
#include <bits/stdc++.h>
using namespace std;


#define f first
#define s second
#define pb push_back
#define mp make_pair
#define ts to_string
#define ub upper_bound
#define lb lower_bound
#define ar array
#define all(x) x.begin(), x.end()
#define siz(x) (int)x.size()
#define FOR(x, y, z) for(int x = (y); x < (z); x++)
#define ROF(x, y, z) for(int x = (y-1); x >= (z); x--)
#define F0R(x, z) FOR(x, 0, z)
#define R0F(x, z) ROF(x, z, 0)
#define trav(x, y) for(auto&x:y)


const string nl = "\n";
using ll = int64_t;
using vi = vector<int>;
using vl = vector<ll>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using str = string;
using vpii = vector<pii>;
using vpll = vector<pll>;


template<class T> inline bool ckmin(T&a, T b) {return b < a ? a = b, 1 : 0;}
template<class T> inline bool ckmax(T&a, T b) {return b > a ? a = b, 1 : 0;}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());


str ts(char c) { return str(1,c); }
str ts(bool b) { return b ? "true" : "false"; }
str ts(const char* s) { return (str)s; }
str ts(str s) { return s; }
template<class A> str ts(complex<A> c) { 
    stringstream ss; ss << c; return ss.str(); }
str ts(vector<bool> v) { 
    str res = "{"; for(int i = 0;i < (int)v.size(); i++) res += char('0'+v[i]);
    res += "}"; return res; }
template<size_t SZ> str ts(bitset<SZ> b) {
    str res = ""; for(int i = 0; i < b.size(); i++) res += char('0'+b[i]);
    return res; }
template<class A, class B> str ts(pair<A,B> p);
template<class T> str ts(T v) { 
    bool fst = 1; str res = "{";
    for (const auto& x: v) {
        if (!fst) res += ", ";
        fst = 0; res += ts(x);
    }
    res += "}"; return res;
}
template<class A, class B> str ts(pair<A,B> p) {
    return "("+ts(p.f)+", "+ts(p.s)+")"; }
void DBG() { cerr << "]" << endl; }
template<class H, class... T> void DBG(H h, T... t) {
    cerr << ts(h); if (sizeof...(t)) cerr << ", ";
    DBG(t...); }


#ifdef D 
#define dbg(...) cerr << "LINE(" << __LINE__ << ") -> [" << #__VA_ARGS__ << "]: [", DBG(__VA_ARGS__)
#else
#define dbg(...) 0
#endif

string n;

signed main(){
    ios_base::sync_with_stdio(0); cin.tie(0);
    cin >> n;
    int sz = siz(n);
    ll sum = 0;
    for(int i=0; i < sz; i++){
        sum += n[i]-'0';
    }
    dbg(sum);
    cout << (sum%9==0?"YES":"NO") << nl;
}
/*
 * Stuff I should try:
 * Is it Monotonic? -> Binary Search
 * Is N small? -> Bitsets or other exponential
 * Edge Cases? Look Carefully 
 * Can't figure anything out? Brute Force and see patterns
 * Try to prove greedies
 * Prefix Sums, Amortization, DP, Data Structures


Compiler output:
a.cc:90:1: error: unterminated comment
   90 | /*
      | ^
Language: Java

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

Compiler output:
Main.java:9: error: ';' expected
            n = n/10
                    ^
1 error
Language: Java

import java.util.Scanner;

public class test {
    public static void main(String []args){
        Scanner in=new Scanner(System.in);
        char []array=in.next().toCharArray();
        int result=0;
        for(char c:array){
            result+= c+'0';
        }
        System.out.println( result%9 ==0?"YES":"NO");


    }
}

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

#include<bits/stdc++.h>
#include<string.h>
#define ll long long 
#include<vector>
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
using namespace std;
const int mod=1e9+7;
int main(){
	IOS;
	string s;
	cin>>n;
	ll sum=0;
	ll n=s.length();
	for(int i=0;i<n;i++)
	sum+=s[i]-'0';
	if(sum%9)
	cout<<"No";
	else
	 cout<<"Yes";
}

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

//AUTHOR - NIMISH UPADHYAY
//FROM IIIT ALLAHABAD
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define UPADHYAY int t;cin>>t;while(t--)
#define pb push_back
#define NIMISH ios_base::sync_with_stdio(false);cin.tie(NULL);
int main(){
    string s;
    cin>>s;
    ll k=0,i,j;
    for(i=0;i<n;i++){
        j=s[i]-'0';
        k+=j;
    }
    if(k%9==0)cout<<"Yes"<<"\n";
    else
    cout<<"No";
}

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

#include<iostream>
using namespace std;
int main(){
  long n;
  cin>>n;
  if (n%3==0){
    printf('yes');}
  else{ printf('no');}
  return 0;
}


Compiler output:
a.cc:7:12: warning: multi-character character constant [-Wmultichar]
    7 |     printf('yes');}
      |            ^~~~~
a.cc:8:16: warning: multi-character character constant [-Wmultichar]
    8 |   else{ printf('no');}
      |                ^~~~
a.cc: In function 'int main()':
a.cc:7:12: error: invalid conversion from 'int' to 'const char*' [-fpermissive]
    7 |     printf('yes');}
      |            ^~~~~
      |            |
      |            int
In file included from /usr/include/c++/14/cstdio:42,
                 from /usr/include/c++/14/ext/string_conversions.h:45,
                 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/stdio.h:363:43: note:   initializing argument 1 of 'int printf(const char*, ...)'
  363 | extern int printf (const char *__restrict __format, ...);
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
a.cc:8:16: error: invalid conversion from 'int' to 'const char*' [-fpermissive]
    8 |   else{ printf('no');}
      |                ^~~~
      |                |
      |                int
/usr/include/stdio.h:363:43: note:   initializing argument 1 of 'int printf(const char*, ...)'
  363 | extern int printf (const char *__restrict __format, ...);
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
 	string number;
  	cin >>number;
  	long result=0;
  	for(int i=0; i<number.length; i++){
     	result+= number[i]-'0'; 
    }
  	if(number=="0"){
      	cout << "YES";
    }
  	else if(result % 9 ==0){
      
     	cout << "YES"; 
    }
  	else{
      cout << "NO";
    }
  
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:31: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() 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<number.length; i++){
      |                        ~~~~~~~^~~~~~
      |                                     ()
Language: C++

#include<bits/stdc++.h>

int main(){
 	string number;
  	cin >>number;
  	long result=0;
  	for(int i=0; i<number.length(); i++){
     	result+= number[i]-'0'; 
    }
  	if(number==0){
      	cout << "YES";
    }
  	else if(result % 9 ==0){
      
     	cout << "YES"; 
    }
  	else{
      cout << "NO";
    }
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:9: error: 'string' was not declared in this scope
    4 |         string number;
      |         ^~~~~~
a.cc:4:9: note: suggested alternatives:
In file included from /usr/include/c++/14/string:41,
                 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/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:5:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |         cin >>number;
      |         ^~~
      |         std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:5:15: error: 'number' was not declared in this scope
    5 |         cin >>number;
      |               ^~~~~~
a.cc:11:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   11 |         cout << "YES";
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:15:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   15 |         cout << "YES";
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:18:7: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   18 |       cout << "NO";
      |       ^~~~
      |       std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~