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

#include <stdio.h>
#include <string>
#include <vector>
#include <math.h>
#include <algorithm>
#include <cstdlib>
#include <typeinfo>
#define rep(i,n) for(int i=0; i < (n); i++)
#define INF 1001001
using namespace std;
 
 
int main(){
  string s;
  int n=0, result=0;
  cin >> s;
  for(int i = 0;i<(int)(s.length());i++){
    n = (int)(s[i])-'0';
    result+=n;
  }
  
  if(result%9==0){
  	cout << "yes" << endl;
  }else{
    cout << "no" << endl;
  }
  
 
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:3: error: 'cin' was not declared in this scope
   16 |   cin >> s;
      |   ^~~
a.cc:8:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    7 | #include <typeinfo>
  +++ |+#include <iostream>
    8 | #define rep(i,n) for(int i=0; i < (n); i++)
a.cc:23:9: error: 'cout' was not declared in this scope
   23 |         cout << "yes" << endl;
      |         ^~~~
a.cc:23:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:23:26: error: 'endl' was not declared in this scope
   23 |         cout << "yes" << endl;
      |                          ^~~~
a.cc:8:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    7 | #include <typeinfo>
  +++ |+#include <ostream>
    8 | #define rep(i,n) for(int i=0; i < (n); i++)
a.cc:25:5: error: 'cout' was not declared in this scope
   25 |     cout << "no" << endl;
      |     ^~~~
a.cc:25:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:25:21: error: 'endl' was not declared in this scope
   25 |     cout << "no" << endl;
      |                     ^~~~
a.cc:25:21: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: C

N=int(input())
if N%9 == 0:
    print("Yes")
else:
    print("No")

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | N=int(input())
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'N' [-Wimplicit-int]
main.c:1:3: error: expected expression before 'int'
    1 | N=int(input())
      |   ^~~
Language: C++

#include <iostream>
#include <stdio.h>
#include <string>
#include <vector>
#include <math.h>
#include <algorithm>
#include <cstdlib>
#include <typeinfo>
#define rep(i,n) for(int i=0; i < (n); i++)
#define INF 1001001
using namespace std;
 
 
int main(){
  string s;
  int n=0, result=0;
  cin >> s;
  for(int i = 0;i<(int)(s.length());i++){
    n = (int)(s[i])-"0";
    result+=n;
  }
  
  if(result%9==0){
  	cout << "yes" << endl;
  }else{
    cout << "no" << endl;
  }
  
 
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:20: error: invalid operands of types 'int' and 'const char [2]' to binary 'operator-'
   19 |     n = (int)(s[i])-"0";
      |                    ^~~~
      |                     |
      |                     const char [2]
Language: Java

import java.util.Scanner;

public class LongTest {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		long sum=0;
		for(char c:s.toCharArray()) {
			sum+=Long.valueOf(c);
		}
		if(sum%9==0) System.out.println("Yes");
		else System.out.println("No");
		System.out.println(sum);
		sc.close();
	}
}

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

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

using namespace boost::multiprecision; // <-- add!!!

int main()
{
    cpp_int n, sum = 0, dig = 0;

    cin >> n;
    if(n%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> // <-- add!!!
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <stdio.h>
int main()
{
  int N;
  int D;

  int S = 0;
 
  scanf("%d", &N);
 
  while(num){
    D = N % 10;
    S = S + D;
    N = N / 10;
  }

  printf("%d\n", S);
 
  return 0;
}


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

#include<bits/stdc++.h>
using namespace std;
#define ll long long int
int main(){
	ll n;
	cin>>n;
	ll k=0;
	while(n!=0){
		k=k+n%10;
		n=n/10;
	}
	if(k%9==0){
		cout<<"Yes";
	}
	else{
		cout<<"No";
	}
	

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

//コンパイラ最適化用
#pragma GCC optimize("Ofast")
#define _GLIBCXX_DEBUG
//インクルード(アルファベット順)
#include<algorithm>//sort,二分探索,など
#include<bitset>//固定長bit集合
#include<chrono>//実行時間計測
#include<cmath>//pow,logなど
#include<complex>//複素数
#include<deque>//両端アクセスのキュー
#include<functional>//sortのgreater
#include<iomanip>//setprecision(浮動小数点の出力の誤差)
#include<iostream>//入出力
#include<iterator>//集合演算(積集合,和集合,差集合など)
#include<map>//map(辞書)
#include<numeric>//iota(整数列の生成),gcdとlcm,accumulate
#include<queue>//キュー
#include<set>//集合
#include<stack>//スタック
#include<string>//文字列
#include<unordered_map>//順序保持しないmap
#include<unordered_set>//順序保持しないset
#include<utility>//pair
#include<vector>//可変長配列
#include<bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;
typedef pair<int, int> pii;
typedef pair<ll, ld> pld;
typedef pair<pii, int> ppiii;
typedef pair<pii, ll> ppiill;
typedef pair<pll, ll> ppllll;
typedef pair<pli, int> pplii;
typedef map<int, int> mii;
typedef deque<ll> dll;
typedef queue<ll> qll;
typedef priority_queue<ll> pqll;
typedef priority_queue<ll, vector<ll>, greater<ll>> pqrll;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<vector<ll>> vvll;
typedef vector<vector<int>> vvint;
typedef vector<vector<pll>> vvpll;

//マクロ
//forループ
//引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか
//Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる
#define REP(i,n) for(ll i=0;i<ll(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=ll(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=ll(b);i--)
//xにはvectorなどのコンテナ
#define ALL(x) x.begin(),x.end() 
#define SIZE(x) ll(x.size()) 
//定数
#define INF 1000000000000 //10^12:∞
#define MOD 1000000007 //10^9+7:合同式の法
#define MAXR 100000 //10^5:配列の最大のrange
//略記
#define PB push_back //挿入
#define MP make_pair //pairのコンストラクタ
#define F first //pairの一つ目の要素
#define S second //pairの二つ目の要素
#define cin(x) cin >> x

signed main(){
    //入力の高速化用のコード
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    //入力
    ll ans = 0;
    string N;
    cin >> N;
    ll size = N.size();
    
    for(ll i=0; i<size;i++){
    if(N[i]!='0'||N[i]!='9'){
    ans += (int) N[i];
      }
    }

    //vll X(N);
    //REP(i,N) cin >> X[i];
    bool ok = false;
    ll count = 0;
    REP(i,size){
      if(S[i]=='9')count ++;
    }
    if(count==size){cout << "Yes";return 0;}


    //本文
    if(ans%9==0||ans%9==9){
        cout << "Yes";return 0;
    }
    if()
    cout << "No" << endl;
    //REP(i,N) cout << ans.at(i) <<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:68:11: error: 'second' was not declared in this scope
   68 | #define S second //pairの二つ目の要素
      |           ^~~~~~
a.cc:93:10: note: in expansion of macro 'S'
   93 |       if(S[i]=='9')count ++;
      |          ^
a.cc:102:8: error: expected primary-expression before ')' token
  102 |     if()
      |        ^
Language: C

#include <stdio.h>
#include<string.h>
int main()
{
    char arr[200005];
    int x=0;
    scanf("%s",arr);
    for(int i=0;i<arr[i]!='\0';i++)
    {
        x=x+int(arr[i]-48);
    }
    if(x%9==0)
    {
        printf("YES\n");
    }
    else
    {
        printf("NO\n");
    }
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:10:13: error: expected expression before 'int'
   10 |         x=x+int(arr[i]-48);
      |             ^~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

bool flag = false;

void nine(long long int n){
  if(n / 10 < 0){
    if(n % 9 == 0)
      flag = true;
    else
      flag = false;
    return;
  }
  
  long long int dig, sum = 0;
  while(n){
    dig = n % 10;
    sum += dig;
    n /= 10;
  }
  nine(sum);
  return;
}
int main(){
 //long long int n, dig, sum = 0;
  
  cin >> n;
  
  /*
  while(n){
    dig = n % 10;
    sum += dig;
    n /= 10;
  }*/
  
  if(flag)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  
  return 0;
}


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

#include <bits/stdc++.h>
using namespace std;
int digit( unsigned long long N )
{
    while( N >= 10 )
    {
        int tmp{};
        while( N > 0 )
        {
            tmp += ( N % 10 );
            N /= 10;
        }
        N = tmp;
    }
    return N;
}
 
int main(){
    long long N;
    cin >> N;
    if (digit( N )%9 == 0) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}
#include <bits/stdc++.h>
using namespace std;
int digit( long long N )
{
    while( N >= 10 )
    {
        int tmp{};
        while( N > 0 )
        {
            tmp += ( N % 10 );
            N /= 10;
        }
        N = tmp;
    }
    return N;
}

int main(){
    unsigned long long N;
    cin >> N;
    if (digit( N )%9 == 0) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}
提出情報
提出日時

Compiler output:
a.cc:42:5: error: redefinition of 'int main()'
   42 | int main(){
      |     ^~~~
a.cc:18:5: note: 'int main()' previously defined here
   18 | int main(){
      |     ^~~~
a.cc:49:1: error: '\U000063d0\U000051fa\U000060c5\U00005831' does not name a type
   49 | 提出情報
      | ^~~~~~~~
Language: C++

@include <stdio.h>
int main()
{
  int N;
  int D;

  int S = 0;
 
  scanf("%d", &N);
 
  while(num){
    D = N % 10;
    S = S + D;
    N = N / 10;
  }

  printf("%d\n", S);
 
  return 0;
}


Compiler output:
a.cc:1:1: error: stray '@' in program
    1 | @include <stdio.h>
      | ^
a.cc:1:2: error: 'include' does not name a type
    1 | @include <stdio.h>
      |  ^~~~~~~
Language: C++

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

int main() {
  int N;
  cin >> N;
  vector<int> M(0);
  while (N > 0) {
    M.push_back(N % 10);
    N /= 10;
  }
  
  int L = 0;
  for (int i = 0; i < M.size(); i++) {
    L += M.at(i);
  }
  
  bool answer = false
    if (L % 9 == 0) {
      answer = true
    }
  
  if (answer) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" <<endl;
  }
}
  
  


Compiler output:
a.cc: In function 'int main()':
a.cc:19:5: error: expected ',' or ';' before 'if'
   19 |     if (L % 9 == 0) {
      |     ^~
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:6:9: error: expected expression before ')' token
    6 |   while(){
      |         ^
Language: C++

#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")
#pragma GCC target("avx,avx2,fma")
#include <iostream>
#define f first
#define s second
#define fore(i,a,b) for(lli i = (a), ThxMK = (b); i < ThxMK; ++i)
#define pb push_back
#define all(s) begin(s), end(s)
#define rall(s) rbegin(s), rend(s)
#define _ ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define sz(s) int(s.size())
#define ENDL '\n'
using namespace std;
typedef long double ld;
typedef long long lli;
typedef pair<lli,lli> ii;
#define deb(x) cout << #x": " << (x) << endl;

int main(){ _
    lli n;
    cin >> n;
    if(n%9==0)
    {
      if(n!==0)cout << "Yes" <<ENDL;
      else cout << "No" <<ENDL;
    }
    else
    {
      cout << "No" <<ENDL;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:13: error: expected primary-expression before '=' token
   24 |       if(n!==0)cout << "Yes" <<ENDL;
      |             ^
Language: C++

#include<iostream>
using namespace std;
 
int main()
{
  long double n;
  long double sum=0, r;
  cin>>n;
  while(n)
  {
    r=n%10;
    sum= sum+r;
    n=n/10;
  }
  if(sum%9==0)
    cout<<"Yes";
  else
    cout<<"No";
  
  return 0;
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:8: error: invalid operands of types 'long double' and 'int' to binary 'operator%'
   11 |     r=n%10;
      |       ~^~~
      |       | |
      |       | int
      |       long double
a.cc:15:9: error: invalid operands of types 'long double' and 'int' to binary 'operator%'
   15 |   if(sum%9==0)
      |      ~~~^~
      |      |   |
      |      |   int
      |      long double
Language: C++

#include <iostream>
using namespace std;

int main () {
  
  vector<int> vec(N);
  
  for (int i = 0; i < N; i++) {
    vec.at(i) += vec.at(i - 1);
    cout << vec.at(i) << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'vector' was not declared in this scope
    6 |   vector<int> vec(N);
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:6:10: error: expected primary-expression before 'int'
    6 |   vector<int> vec(N);
      |          ^~~
a.cc:8:23: error: 'N' was not declared in this scope
    8 |   for (int i = 0; i < N; i++) {
      |                       ^
a.cc:9:5: error: 'vec' was not declared in this scope
    9 |     vec.at(i) += vec.at(i - 1);
      |     ^~~
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#include <string>

using namespace std;
using ll = long long;
using P = pair<int,int>;
int main() {
  int a = 0;
  int b = 0;
  int c = 0;
  
  cin >> a;
  string d  = std::to_string(a);
  rep(i,d.length()){
    b = b + std::stoi(d[i])
  }
  if (b%9 == 0){
     cout << "Yes" << endl;
  }
  else{
     cout << "No" << endl;
  }
  
 
 
 
  return 0;
}


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

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

int main() {
	str n;
	cin>>n;
	int sum=0;
	
	while(auto i:n){
		
		sum+=i;
		
	}
	if(sum%9==0){
		cout<<"Yes";
	}
	else{
		cout<<"No";
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: 'str' was not declared in this scope; did you mean 'std'?
    5 |         str n;
      |         ^~~
      |         std
a.cc:6:14: error: 'n' was not declared in this scope; did you mean 'yn'?
    6 |         cin>>n;
      |              ^
      |              yn
a.cc:9:21: error: found ':' in nested-name-specifier, expected '::'
    9 |         while(auto i:n){
      |                     ^
      |                     ::
a.cc:9:20: error: 'i' has not been declared
    9 |         while(auto i:n){
      |                    ^
a.cc:9:23: error: qualified-id in declaration before ')' token
    9 |         while(auto i:n){
      |                       ^
a.cc:11:22: error: 'i' was not declared in this scope
   11 |                 sum+=i;
      |                      ^
Language: C

#include <stdio.h>

int main(void)
{
	int N;
	int dig;
	int sum = 0;

	scanf_s("%d", &N,10^200000);

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

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

	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    9 |         scanf_s("%d", &N,10^200000);
      |         ^~~~~~~
      |         scanf
main.c:9:28: warning: result of '10^200000' is 200010; did you mean '1e200000'? [-Wxor-used-as-pow]
    9 |         scanf_s("%d", &N,10^200000);
      |                            ^
      |                          ---
      |                          1e
main.c:9:26: note: you can silence this warning by using a hexadecimal constant (0xa rather than 10)
    9 |         scanf_s("%d", &N,10^200000);
      |                          ^~
      |                          0xa
Language: Java

import java.math.BigDecimal;

public class Main {
  public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
    String str_scan = scan.nextLine();

    BigDecimal N = new BigDecimal(str_scan);
    var ans = "No";
    double amari = 0;
    double sum = 0;
    int keta = 0;

    keta = N.precision();
    char[] work = new char[keta];

    for(var i = 0; i < keta; i++){
      sum += Double.parseDouble(String.valueOf(str_scan.charAt(i)));
    }

    if ( (sum % 9) == 0 ) {
      ans = "Yes";
    }

    System.out.println(ans);
    scan.close();
  }
}

Compiler output:
Main.java:5: error: cannot find symbol
    Scanner scan = new Scanner(System.in);
    ^
  symbol:   class Scanner
  location: class Main
Main.java:5: error: cannot find symbol
    Scanner scan = new Scanner(System.in);
                       ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#include <string>

using namespace std;
using ll = long long;
using P = pair<int,int>;
int main() {
  int a = 0;
  int b = 0;
  int c = 0;
  
  cin >> a;
  string d  = a.str();
  rep(i,d.length()){
    b = b + std::stoi(d[i])
  }
  if (b%9 == 0){
     cout << "Yes" << endl;
  }
  else{
     cout << "No" << endl;
  }
  
 
 
 
  return 0;
}


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

#include <iostream>
#include <math.h>
#include <string>
using namespace std;

int ninsum(long long _n) {
    if (_n < 10) {
        return _n;
    }
    else {
        string nd;

        nd = to_string(_n);

        long long sum = 0;
        for (int i = 0; i < nd.length(); i++) {
            sum += long long(nd[i]);
        }

        ninsum(sum);
    }
}

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

    string ans;
    if (ninsum(n) == 9) {
        ans = "Yes";
    }
    else {
        ans = "No";
    }

    cout << ans;
}

Compiler output:
a.cc: In function 'int ninsum(long long int)':
a.cc:17:20: error: expected primary-expression before 'long'
   17 |             sum += long long(nd[i]);
      |                    ^~~~
a.cc:22:1: warning: control reaches end of non-void function [-Wreturn-type]
   22 | }
      | ^
Language: C++

#include<iostream>
using namespace std;
 
int main()
{
  unsigned long double n;
   unsigned long double sum=0, r;
  cin>>n;
  while(n)
  {
    r=n%10;
    sum= sum+r;
    n=n/10;
  }
  if(sum%9==0)
    cout<<"Yes";
  else
    cout<<"No";
  
  return 0;
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'unsigned' specified with 'long double'
    6 |   unsigned long double n;
      |   ^~~~~~~~
a.cc:7:4: error: 'unsigned' specified with 'long double'
    7 |    unsigned long double sum=0, r;
      |    ^~~~~~~~
a.cc:7:4: error: 'unsigned' specified with 'long double'
a.cc:11:8: error: invalid operands of types 'long double' and 'int' to binary 'operator%'
   11 |     r=n%10;
      |       ~^~~
      |       | |
      |       | int
      |       long double
a.cc:15:9: error: invalid operands of types 'long double' and 'int' to binary 'operator%'
   15 |   if(sum%9==0)
      |      ~~~^~
      |      |   |
      |      |   int
      |      long double
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main (){
  int sum = 0;
  string hoge;
  cin >> hoge;
  vector <char> data (hoge.size());
  for (int i = 0;i < hoge.size();i++){
    data.push_back(hoge.at(i));
  }
  for(int i = 0;i < data.size();i++){
    sum += data.at(i);
  }
  vector <int>hoge2 (data.size());
  int s2 = 0;
  for (int i = 0;i < sum.size();i++){
    hoge2.push_back(data.at(i));
  }
  for(int i = 0;i < data.size();i++){
    s2 += hoge2.at(i);
  if ((s2 % 9 == 0) || (hoge == "0")){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:26: error: request for member 'size' in 'sum', which is of non-class type 'int'
   16 |   for (int i = 0;i < sum.size();i++){
      |                          ^~~~
a.cc:26:2: error: expected '}' at end of input
   26 | }
      |  ^
a.cc:3:12: note: to match this '{'
    3 | int main (){
      |            ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int a;
  vector<int> vec(N);
for (int i = 0; i < N; i++) {
  cin >> vec.at(i);
  a=vec.at(i);
}
if(a%9==0){
  cout<<"Yes"<<'\n';
}else{
  cout<<"No"<<'\n';
}
  return(0);
}


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);
      |                   ^
Language: C++

#include <iostream>
#include <stdio.h>
using namespace std;

int main()
{
	char buff[256];
	int cnt = 0;
	cin >> buff;
	for (int i = 0; i < strlen(buff); i++)
	{
		cnt += (int)(buff[i] - '0');
	}
	if (cnt != 0 && cnt % 9 == 0) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:29: error: 'strlen' was not declared in this scope
   10 |         for (int i = 0; i < strlen(buff); i++)
      |                             ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | #include <stdio.h>
Language: C

#include <stdio.h>

int main(){
	int N;
	int syo;
	int sum = 0;
	
	scanf_s("%d",&N);
	
	while(N){
		syo = N % 10;
		sum = sum + syo;
		N = N / 10;
	}
	
	if(sum % 9 ==  N % 9){
		printf("Yes");
	}else{
		printf("No");
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    8 |         scanf_s("%d",&N);
      |         ^~~~~~~
      |         scanf
Language: Java

import java.util.Scanner;
import java.util.Arrays;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import java.util.HashSet;

class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String  N=sc.next();
    String []hairetu = N.split("");
    int sum=0;
    for (int i=0;i<hairetu.length ;i++ ) {
      if(hairetu[i].equals(".")){
        i++;
      }
      if(hairetu[i].equals("E")){
       break;
      }
      sum=sum+Integer.parseInt(hairetu[i]);
    }
    if(sum%9==0|N%9==0){
      System.out.println("Yes");
    }else{
      System.out.println("No");
    }
}
}


Compiler output:
Main.java:23: error: bad operand types for binary operator '%'
    if(sum%9==0|N%9==0){
                 ^
  first type:  String
  second type: int
1 error
Language: C++

int main()
{

    string s;

    cin >> s;

    long long x = 0;
    long long n=s.length();
    for (int i = 0; i <n; i++)

        x += (int)s[i] - '0';

    if (x % 9 == 0)
        cout << "YES\n";
    else
        cout << "NO\n";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:5: error: 'string' was not declared in this scope
    4 |     string s;
      |     ^~~~~~
a.cc:6:5: error: 'cin' was not declared in this scope
    6 |     cin >> s;
      |     ^~~
a.cc:6:12: error: 's' was not declared in this scope
    6 |     cin >> s;
      |            ^
a.cc:15:9: error: 'cout' was not declared in this scope
   15 |         cout << "YES\n";
      |         ^~~~
a.cc:17:9: error: 'cout' was not declared in this scope
   17 |         cout << "NO\n";
      |         ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define FIO ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define endl '\n'
#define fo(i,n) for(int i=0;i<=n;++i)
#define Fo(i,k,n) for(int i=k;i<n;++i)
typedef long long int lli;
int main(){
    FIO
    string str; cin>>str;
    int rem,s=0;
    int si=str.size()
    fo(i,si){
      while(str>0){
      rem=str%10;
      s=s+rem;
      str/=10;
    }
    }
  if(s%9==0) cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:17: error: expected ',' or ';' before 'for'
    5 | #define fo(i,n) for(int i=0;i<=n;++i)
      |                 ^~~
a.cc:13:5: note: in expansion of macro 'fo'
   13 |     fo(i,si){
      |     ^~
a.cc:13:8: error: 'i' was not declared in this scope; did you mean 'si'?
   13 |     fo(i,si){
      |        ^
a.cc:5:29: note: in definition of macro 'fo'
    5 | #define fo(i,n) for(int i=0;i<=n;++i)
      |                             ^
Language: C++

#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define debug(n) cout << "DEBUG1 " << n << "\n";
#define debug2(n, m) cout << "DEBUG2 " << n << ' ' << m << "\n";
#define debug3(n, m, x) cout << "DEBUG3 " << n << ' ' << m << ' ' << x << "\n";
#define debug4(n, m, x, y) cout << "DEBUG3 " << n << ' ' << m << ' ' << x << ' ' << y << "\n";
#define ss_def stringstream ss // stringstream, do ss_def(str), then ss >> n (n is int)
#define upzero(n) rrn < 0) n = 0
#define alive(n) cout << "Alive here: checkpoint " << n << endl
#pragma GCC optimize("Ofast")
using namespace std;
void yes() {
    cout << "YES\n";
    return;
}
void no() {
    cout << "NO\n";
    return;
}
void solve(int case_no) {
    // implementation
    string str;
    cin >> str;
    int strl = str.length();
    int cnt = 0;
    for (int i = 0;i < strl;i++) {
    	cnt += str[i] - 48;
	}
	return (str[i] % 9 ? no() : yes());
}
int main() {
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    srand(time(NULL));
    int t = 1;
//    cin >> t;
    for (int i = 1;i <= t;i++) solve(i);
}
/*

*/

Compiler output:
a.cc: In function 'void solve(int)':
a.cc:30:21: error: 'i' was not declared in this scope
   30 |         return (str[i] % 9 ? no() : yes());
      |                     ^
Language: C++

#include <iostream>
using namespace std;

int main() {
  int N;
  cin >> N ;
  int sum;
  while (N > 0) { // n が 0 になるまで
    sum += N % 10;
    N /= 10;
  }
  return sum;
  if(total % 9 == 0){ 
    cout << "Yes" << endl;
  }
  else{ 
    cout << "No" << endl;
  }
}

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

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

int main() {
    string N;
    cin >> N;
    int64_t ans = 0;
  	if (N.size() == 1 && N.at(0) == 0) {
      cout << "No" << endl;
      return 0;
    }
  	cout << l << endl;
    for (int i = 0; i < l; i++) {
        if (N[i] != 0 && N[i] != 9) {
            ans = (ans + N[i]) % 9;
        }
    }
    if (ans == 0) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:17: error: 'l' was not declared in this scope
   12 |         cout << l << endl;
      |                 ^
Language: C++

#include <iostream>
using namespace std;

int main() {
  int N;
  cin >> N ;
  while (N > 0) { // n が 0 になるまで
    sum += N % 10;
    N /= 10;
  }
  return sum;
  if(total % 9 == 0){ 
    cout << "Yes" << endl;
  }
  else{ 
    cout << "No" << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: 'sum' was not declared in this scope
    8 |     sum += N % 10;
      |     ^~~
a.cc:11:10: error: 'sum' was not declared in this scope
   11 |   return sum;
      |          ^~~
a.cc:12:6: error: 'total' was not declared in this scope
   12 |   if(total % 9 == 0){
      |      ^~~~~
Language: C

31415926535897932384626433832795028841971693993751058209749445923078164062862089986280

Compiler output:
main.c:1:1: warning: integer constant is too large for its type
    1 | 31415926535897932384626433832795028841971693993751058209749445923078164062862089986280
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.c:1:1: error: expected identifier or '(' before numeric constant
Language: C

#include<stdio.h>
int main()
{
    int N;
    // 整数の入力
    scanf("%d", &N);
  	int sum=0;
  	while (N>=1){
      int a= N%10;
      sum = sum+a;
      N = N/10
    }
    if (sum%9==0){
      printf("Yes");
    }
   	else {
      printf("No")
    }
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:15: error: expected ';' before '}' token
   11 |       N = N/10
      |               ^
      |               ;
   12 |     }
      |     ~          
main.c:17:19: error: expected ';' before '}' token
   17 |       printf("No")
      |                   ^
      |                   ;
   18 |     }
      |     ~
Language: Java

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String N = sc.nextLine();
    long sum = 0;
    for (int i = 0; i < N.length(); i++) {
      sum += N.charAt(i);
    }
    if (sum == 0) {
      System.out.println("Yes");
      break;
    } else if (sum % 9 == 0) {
      System.out.println("Yes");
    } else {
      System.out.println("No");
    }
  }
}


Compiler output:
Main.java:13: error: break outside switch or loop
      break;
      ^
1 error
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:17:3: error: expected '}' before 'else'
   17 |   else if
      |   ^~~~
a.cc:15:13: note: to match this '{'
   15 |   if(A == 0){
      |             ^
a.cc:18:5: error: expected '(' before 'cout'
   18 |     cout << "No" << endl;
      |     ^~~~
      |     (
a.cc: At global scope:
a.cc:20:1: error: expected declaration before '}' token
   20 | }
      | ^
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:17:3: error: expected '}' before 'else'
   17 |   else if(!A == 0)
      |   ^~~~
a.cc:15:13: note: to match this '{'
   15 |   if(A == 0){
      |             ^
a.cc: At global scope:
a.cc:20:1: error: expected declaration before '}' token
   20 | }
      | ^
Language: C++

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

int main(){
string n;
cin>>n;
int i,l;
long long sum=0;
l=n.size();
for(i=0;i<l;i++){
    sum=sum+s[i]-48;
}
cout<<sum;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:13: error: 's' was not declared in this scope
   11 |     sum=sum+s[i]-48;
      |             ^
Language: C

#include<stdio.h>
#include<stdlib.h>

int main( void )
{
  int num, sum, dig;

  scanf( "%d", &num );

  sum = 0;

  while( num ){

    dig = num % 10;
    sum += dig;
    num = num / 10;
    i++;
  }
  
  if( sum % 9 == 0 && sum != 0 ) {
    puts( "Yes" );
  }
  
  else {
    puts( "No" );
  }

  free( dig );
  
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:17:5: error: 'i' undeclared (first use in this function)
   17 |     i++;
      |     ^
main.c:17:5: note: each undeclared identifier is reported only once for each function it appears in
main.c:28:9: error: passing argument 1 of 'free' makes pointer from integer without a cast [-Wint-conversion]
   28 |   free( dig );
      |         ^~~
      |         |
      |         int
In file included from main.c:2:
/usr/include/stdlib.h:687:25: note: expected 'void *' but argument is of type 'int'
  687 | extern void free (void *__ptr) __THROW;
      |                   ~~~~~~^~~~~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:15:3: error: expected ',' or ';' before 'if'
   15 |   if(A == 0){
      |   ^~
a.cc:18:3: error: 'else' without a previous 'if'
   18 |   else if(!A == 0){
      |   ^~~~
Language: C

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


int main(){
  char aaa[200009];
  
  scanf("%s", aaa);
  long long int ss = 0;
  
for (int j = 0; j < strlen(aaa); ++j){
    if (aaa[j] == '1')
      ss += 1;
    else if (aaa[j] == '2')
      ss += 2;
    else if (aaa[j] == '3')
      ss += 3;
    else if (aaa[j] == '4')
      ss += 4;
    else if (aaa[j] == '5')
      ss += 5;
    else if (aaa[j] == '6')
      ss += 6;
    else if (aaa[j] == '7')
      ss += 7;
    else if (aaa[j] == '8')
      ss += 8;
    else if (aaa[j] == '9')
      ss += 9;
    else
      ss += 0;
}
  
  //printf("%d\n", ss);
  
  if (ss % 9 == 0)
    printf("Yes\n");
  else
    printf("No\n");

  return 0;
}

Compiler output:
main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include <stdio.h>
      |         ^
In file included from /usr/include/stdlib.h:514,
                 from main.c:3:
/usr/include/x86_64-linux-gnu/sys/types.h:33:9: error: unknown type name '__u_char'; did you mean '__u_short'?
   33 | typedef __u_char u_char;
      |         ^~~~~~~~
      |         __u_short
main.c: In function 'main':
main.c:10:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   10 |   scanf("%s", aaa);
      |   ^~~~~
main.c:5:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
    4 | #include <string.h>
  +++ |+#include <stdio.h>
    5 | 
main.c:10:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   10 |   scanf("%s", aaa);
      |   ^~~~~
main.c:10:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:39:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   39 |     printf("Yes\n");
      |     ^~~~~~
main.c:39:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:39:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:39:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:41:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   41 |     printf("No\n");
      |     ^~~~~~
main.c:41:5: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#include<stdio.h>
int main()
{
    int N;
    // 整数の入力
    scanf("%d", &N);
  	int sum=0;
  	while (N>=1){
      int a= N%10;
      sum = sum+a;
      N = N/10
    if (sum%9==0){
      printf("Yes");}
   	else {
      printf("No")}
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:15: error: expected ';' before 'if'
   11 |       N = N/10
      |               ^
      |               ;
   12 |     if (sum%9==0){
      |     ~~         
main.c:17:1: error: expected declaration or statement at end of input
   17 | }
      | ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:19: error: invalid operands of types 'double' and 'double' to binary 'operator%'
    8 |     sum = sum + N % 10.0;
      |                 ~ ^ ~~~~
      |                 |   |
      |                 |   double
      |                 double
a.cc:11:10: error: invalid operands of types 'double' and 'double' to binary 'operator%'
   11 |   if(sum % 9.0 == 0){
      |      ~~~ ^ ~~~
      |      |     |
      |      |     double
      |      double
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:19: error: invalid operands of types 'double' and 'int' to binary 'operator%'
    8 |     sum = sum + N % 10;
      |                 ~ ^ ~~
      |                 |   |
      |                 |   int
      |                 double
a.cc:11:10: error: invalid operands of types 'double' and 'int' to binary 'operator%'
   11 |   if(sum % 9 == 0){
      |      ~~~ ^ ~
      |      |     |
      |      |     int
      |      double
Language: C++

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define INF 1e18 //10^12:∞

long long int sum(long long int n)
{
  if(n < 10;) return n;
  return sum(n/10) + n%10;
}

int main()
{
  long long int n;
  cin >> n;
  while(n > 100)
  {
    n = sum(n);
  }
  if(n%9 == 0) cout << "Yes";
  else cout << "No";
  
  return 0;
}

Compiler output:
a.cc: In function 'long long int sum(long long int)':
a.cc:9:13: error: expected primary-expression before ')' token
    9 |   if(n < 10;) return n;
      |             ^
Language: C++

//                     ?????? ???????? ???????????? ??????????
//                   ?? ?????? ????? ?????? ????????? ??????? ??????




#include <bits/stdc++.h>

using namespace std;
#define endl "\n"

int main()
{

    string x;
    cin >> x;
    long long sum = 0;
    for(int i = 0 ; i < x.size() ; i++) sum += x[i] - '0';
	if(sum % 9 ==) cout << "Yes" << endl;
	else cout << "No" << endl;
    
    
    
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:22: error: expected primary-expression before ')' token
   19 |         if(sum % 9 ==) cout << "Yes" << endl;
      |                      ^
Language: C++

#include <iostream>
using namespace std;

// 各桁の和を計算する関数
int findSumOfDigits(int n) {
  int sum = 0;
  while (n > 0) { // n が 0 になるまで
    sum += n % 10;
    n /= 10;
  }
  return sum;
}

int main() {
  int N;
  cin >> N ;
  int total = 0;
  for (int i = 1; i <= N; ++i) {
    int sum = findSumOfDigits(i); // i の各桁の和
      total += i;
    }
  
  if(total % 9 == 0){ cout << "Yes" << endl}
  else{ cout << "No" << endl}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:44: error: expected ';' before '}' token
   23 |   if(total % 9 == 0){ cout << "Yes" << endl}
      |                                            ^
      |                                            ;
a.cc:24:29: error: expected ';' before '}' token
   24 |   else{ cout << "No" << endl}
      |                             ^
      |                             ;
Language: C++

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


Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:11:8: error: invalid operands of types 'double' and 'int' to binary 'operator%'
   11 |     r=n%10;
      |       ~^~~
      |       | |
      |       | int
      |       double
Language: C++

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

long int digit_sum(string);

int main() {
	long int n;
	cin >> n;
	string str = to_string(n);

	long int ans = digit_sum(str);

	cout << ans;
	cout << ((ans % 9 == 0)? "Yes" : "No");

	return 0;
}

long int digit_sum(string num) {
	long int ans = 0;
	for (int i = 0; i < num.length(); i++) {
		ans += (int)(num[i] - '0');
	}
	return ans;
}

//made by myself


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

#include <iostream>
#include <math.h>
#include <string>
using namespace std;

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

    string nd;
    string ans;

    nd = to_string(n);

    int sum = 0;
    for (int i = 0; i < nd.length(); i++) {
        sum += int(nd[i]);
    }

    double dob;
    dob = sum / 9;
    string ans;
    if (sum - dob * 9 == 0) {
        ans = "Yes";
    }
    else {
        ans = "No";
    }

    cout << ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:12: error: redeclaration of 'std::string ans'
   23 |     string ans;
      |            ^~~
a.cc:12:12: note: 'std::string ans' previously declared here
   12 |     string ans;
      |            ^~~
Language: C++

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

int main() {
	long int n;
  int sum;
	cin>>n;
  	copy=n;
  sum=0;
   while(n>0){
     rem=n%10;
     sum+=rem;
   n=n/10;
   }
	if(sum%9==0)
	cout<<"Yes";
	else
	cout<<"No";
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:14: error: overloaded function with no contextual type information
    8 |         copy=n;
      |              ^
a.cc:11:6: error: 'rem' was not declared in this scope; did you mean 'drem'?
   11 |      rem=n%10;
      |      ^~~
      |      drem
Language: C++

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

int main() {
  vector<int> s(200005);
  int count=0;
  int ans;
  for(int i=0;i<200005;i++){
    cin>>s[i];
  }
  for(int i=0;i<200005;i++){
    count+=s[i]
  }
  ans=count%9;
  if(ans==0){
    cout<<"Yes"<<endl;
  }
  else{
    cout<<"No"<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:16: error: expected ';' before '}' token
   12 |     count+=s[i]
      |                ^
      |                ;
   13 |   }
      |   ~
Language: C++

#include <iostream>
using namespace std;

// 各桁の和を計算する関数
int findSumOfDigits(int n) {
  int sum = 0;
  while (n > 0) { // n が 0 になるまで
    sum += n % 10;
    n /= 10;
  }
  return sum;
}

int main() {
  int N;
  cin >> N ;
  int total = 0;
  for (int i = 1; i <= N; ++i) {
    int sum = findSumOfDigits(i); // i の各桁の和
      total += i;
    }
  }
  
  if(total % 9 == 0) cout << "Yes" << endl;
  else cout << '"No" << endl;
}

Compiler output:
a.cc:25:16: warning: missing terminating ' character
   25 |   else cout << '"No" << endl;
      |                ^
a.cc:25:16: error: missing terminating ' character
   25 |   else cout << '"No" << endl;
      |                ^~~~~~~~~~~~~~
a.cc:24:3: error: expected unqualified-id before 'if'
   24 |   if(total % 9 == 0) cout << "Yes" << endl;
      |   ^~
a.cc:25:3: error: expected unqualified-id before 'else'
   25 |   else cout << '"No" << endl;
      |   ^~~~
a.cc:26:1: error: expected declaration before '}' token
   26 | }
      | ^
Language: Java

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    long N = sc.nextLong();
    long sum = 0;
    for (int i = 0; i < N.length(); i++) {
      sum += N.charAt(i);
    }
    if (sum % 9 == 0) {
      System.out.println("Yes");
    } else {
      System.out.println("No");
    }
  }
}


Compiler output:
Main.java:8: error: long cannot be dereferenced
    for (int i = 0; i < N.length(); i++) {
                         ^
Main.java:9: error: long cannot be dereferenced
      sum += N.charAt(i);
              ^
2 errors
Language: Java

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    long N = sc.nextLong();
    long sum = 0;
    for (int N = 0; i < N.length(); i++) {
      sum += N.charAt(i);
    }
    if (sum % 9 == 0) {
      System.out.println("Yes");
    } else {
      System.out.println("No");
    }
  }
}

Compiler output:
Main.java:8: error: variable N is already defined in method main(String[])
    for (int N = 0; i < N.length(); i++) {
             ^
Main.java:8: error: cannot find symbol
    for (int N = 0; i < N.length(); i++) {
                    ^
  symbol:   variable i
  location: class Main
Main.java:8: error: int cannot be dereferenced
    for (int N = 0; i < N.length(); i++) {
                         ^
Main.java:8: error: cannot find symbol
    for (int N = 0; i < N.length(); i++) {
                                    ^
  symbol:   variable i
  location: class Main
Main.java:9: error: cannot find symbol
      sum += N.charAt(i);
                      ^
  symbol:   variable i
  location: class Main
Main.java:9: error: int cannot be dereferenced
      sum += N.charAt(i);
              ^
6 errors