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

#include<stdio.h>
int main (void){
  int a,b,c,d;
  float e;
  scanf("%d %d %d %d",&a &b &c &d);
  a+b-c-d=e;
  if(e<0){
    printf("Left");
  }else if(e==0){printf("Balanced");
                }else{printf("Right");
                             }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:26: error: invalid operands to binary & (have 'int *' and 'int')
    5 |   scanf("%d %d %d %d",&a &b &c &d);
      |                       ~~ ^
      |                       |
      |                       int *
main.c:6:10: error: lvalue required as left operand of assignment
    6 |   a+b-c-d=e;
      |          ^
Language: Java

import java.util.*;
public class Main {
	public static void(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int d = sc.nextInt();
		int left = a + b;
		int right = c + d;
		
		if (left > right) {
		 System.out.printIn(“Left");
		} else if (left == right) {
		 System.out.printIn(“Balanced");
		} else if (left < right) {
		 System.out.printIn("Right");
		}
	}
}
import java.util.* ;
public class Main {
	public static void(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int d = sc.nextInt();
		int left = a + b;
		int right = c + d;
		
		if (left > right) {
		 System.out.printIn(“Left");
		} else if (left == right) {
		 System.out.printIn(“Balanced");
		} if (left < right) {
		 System.out.printIn("Right");
		}
	}
}


Compiler output:
Main.java:3: error: <identifier> expected
	public static void(String[] args) {
	                  ^
Main.java:13: error: illegal character: '\u201c'
		 System.out.printIn(?Left");
		                    ^
Main.java:13: error: unclosed string literal
		 System.out.printIn(?Left");
		                         ^
Main.java:13: error: not a statement
		 System.out.printIn(?Left");
		                     ^
Main.java:15: error: illegal character: '\u201c'
		 System.out.printIn(?Balanced");
		                    ^
Main.java:15: error: unclosed string literal
		 System.out.printIn(?Balanced");
		                             ^
Main.java:15: error: not a statement
		 System.out.printIn(?Balanced");
		                     ^
Main.java:21: error: class, interface, enum, or record expected
import java.util.* ;
^
Main.java:23: error: <identifier> expected
	public static void(String[] args) {
	                  ^
Main.java:33: error: illegal character: '\u201c'
		 System.out.printIn(?Left");
		                    ^
Main.java:33: error: unclosed string literal
		 System.out.printIn(?Left");
		                         ^
Main.java:33: error: not a statement
		 System.out.printIn(?Left");
		                     ^
Main.java:35: error: illegal character: '\u201c'
		 System.out.printIn(?Balanced");
		                    ^
Main.java:35: error: unclosed string literal
		 System.out.printIn(?Balanced");
		                             ^
Main.java:35: error: not a statement
		 System.out.printIn(?Balanced");
		                     ^
15 errors
Language: Java

import java.util.* ;
public class Main {
	public static void(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int d = sc.nextInt();
		int left = a + b;
		int right = c + d;
		
		if (left > right) {
		 System.out.printIn(“Left");
		} else if (left == right) {
		 System.out.printIn(“Balanced");
		} else if (left < right) {
		 System.out.printIn("Right");
		}
	}
}

Compiler output:
Main.java:3: error: <identifier> expected
	public static void(String[] args) {
	                  ^
Main.java:13: error: illegal character: '\u201c'
		 System.out.printIn(?Left");
		                    ^
Main.java:13: error: unclosed string literal
		 System.out.printIn(?Left");
		                         ^
Main.java:13: error: not a statement
		 System.out.printIn(?Left");
		                     ^
Main.java:15: error: illegal character: '\u201c'
		 System.out.printIn(?Balanced");
		                    ^
Main.java:15: error: unclosed string literal
		 System.out.printIn(?Balanced");
		                             ^
Main.java:15: error: not a statement
		 System.out.printIn(?Balanced");
		                     ^
7 errors
Language: Java

import java.util.*;
public class Main {
  public static void main(String...args) {
  	final Scanner sc = new Scanner(System.in);
    final int left = sc.nextInt() + sc.nextInt();
    final int right = sc.nextInt() + sc.nextInt();
    final int sigum = Math.signum(left - right);
    switch(signum) {
      case 0: System.out.println("Balanced"); break;
      case 1: System.out.println("Left"); break;
      case -1: System.out.println("Right"); break;
    }
  }
}

Compiler output:
Main.java:7: error: incompatible types: possible lossy conversion from float to int
    final int sigum = Math.signum(left - right);
                                 ^
Main.java:8: error: cannot find symbol
    switch(signum) {
           ^
  symbol:   variable signum
  location: class Main
2 errors
Language: Java

import java.util.*;
public class Main {
	public static void(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int d = sc.nextInt();
		int left = a + b
		int right = c + d
		
		if (left > right) {
		 System.out.printIn(“Left")
		} else if (left == right) {
		 System.out.printIn(“Balanced")
		} else if (left < right) {
		 System.out.printIn(Right)
		}
	}
}

Compiler output:
Main.java:3: error: <identifier> expected
	public static void(String[] args) {
	                  ^
Main.java:9: error: ';' expected
		int left = a + b
		                ^
Main.java:10: error: ';' expected
		int right = c + d
		                 ^
Main.java:13: error: illegal character: '\u201c'
		 System.out.printIn(?Left")
		                    ^
Main.java:13: error: unclosed string literal
		 System.out.printIn(?Left")
		                         ^
Main.java:13: error: not a statement
		 System.out.printIn(?Left")
		                     ^
Main.java:15: error: illegal character: '\u201c'
		 System.out.printIn(?Balanced")
		                    ^
Main.java:15: error: unclosed string literal
		 System.out.printIn(?Balanced")
		                             ^
Main.java:15: error: not a statement
		 System.out.printIn(?Balanced")
		                     ^
Main.java:17: error: ';' expected
		 System.out.printIn(Right)
		                          ^
10 errors
Language: C++

#include<iostream>

using namespace std;

int main(){
  int a,b,c,d;
  cin>>a>>b>>c>>D;
  if(a+b>c+d)cout<<"Left";
  else if(a+b<c+d)cout<<"Right";
  else cout<<"Balanced";
  cout<<endl;
  
 return 0; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:17: error: 'D' was not declared in this scope
    7 |   cin>>a>>b>>c>>D;
      |                 ^
Language: C++

#include <iostream>
using namespace std;
int main()
{
	int N;
	int A;
	int B;
	int sum = 0;
	int ten;
	int ichi;

	cin >> N >> A >> B;
	for (int i = 1; i < =N; i++)
	{
		ten = i / 10;
		ichi = i % 10;
		if (ten + ichi >= A && ten + ichi <= B)
			sum += i;
	}
	cout << sum;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:29: error: expected primary-expression before '=' token
   13 |         for (int i = 1; i < =N; i++)
      |                             ^
Language: C++

#include <math.h>
#include <stdio.h>
int main()
{
  int N,A,B;
  int d=0;
  int c[5];
  scanf("%d %d %d",&N,$A,&B);
  for(int k=1;k<=N;k++){
    	c[0]=k%10;
		c[1]=k%100;
    	c[2]=k%1000;
    	c[3]=k%10000;
    	c[4]=k%100000;
    	if(A<=c[0]+c[1]+c[2]+c[3]+c[4]||B>=c[0]+c[1]+c[2]+c[3]+c[4]){
          	d=d+c[0]+c[1]+c[2]+c[3]+c[4];
        }
  }printf("%d",d);
  return(0)
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:23: error: '$A' was not declared in this scope; did you mean 'A'?
    8 |   scanf("%d %d %d",&N,$A,&B);
      |                       ^~
      |                       A
a.cc:19:12: error: expected ';' before '}' token
   19 |   return(0)
      |            ^
      |            ;
   20 | }
      | ~
Language: C++

#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
int main(){
	int a,b,c,d;
		scanf("%d%d%d%d",&a,&b,&c,&d)
		if(a+b>c+d)
			printf("left\n");
		if(a+b==c+d)
			printf("Blanced\n");
		if(a+b<c+d)
			printf("Right\n");
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:46: error: expected ';' before 'if'
    9 |                 scanf("%d%d%d%d",&a,&b,&c,&d)
      |                                              ^
      |                                              ;
   10 |                 if(a+b>c+d)
      |                 ~~
Language: C++

#include<iostream>
using namespace std;
int main() {
	int N, A, B;
  	cin >> N >> A >> B;
  	int sum = 0;
  	int sum1 = 0;
  	for(int j = 1; j <= N; j++){
  	for(int i = j; (i / 10) != 0 || (i % 10) != 10; i /= 10) {
      	sum1 += (i % 10);
    }
  	if(sum1 >= A && sum1 <= B) {
      	sum += 10
    }
    }
  	cout << sum << endl;
  	return 0;
}

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

#include <iostream>

int digitTotal(int x)
{
	int d4 = x / 1000;
	int d3 = x / 100 - d4 * 1000;
	int d2 = x / 10 - d3 * 100 - d4 * 1000;
	int d1 = x - d2 * 10 - d3 * 100 - d4 * 1000;
	return d1 + d2 + d3 + d4;
}

int main()
{
	int n, a, b;

	std::cin >> n >> a >> b;

	int total;
	int sum = 0;
	for (int i = 1; i <= n; ++i)
	{
		total = digitTotal(i);
		if (total >= a && total <= b)
			sum += i;
	}

	std::cout << sum << endl;

    return 0;
}

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

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int d = sc.nextInt();
		// 文字列の入力
		if ( a + b = c + d ) {
          System.out.println("Balanced");
        } else if ( a + b > c + d ) {
          System.out.println("Left");
        } else {
          System.out.println("Right");
        }
	}
}

Compiler output:
Main.java:11: error: unexpected type
		if ( a + b = c + d ) {
		       ^
  required: variable
  found:    value
1 error
Language: C++

#include <csdio>
#include <cmath>
#include <cstring>
#include <algorithm>
using namespace std;
int a, b, c, d;
int main()
{
	while(~scanf("%d %d %d %d",&a, &b, &c, &d))
	{
		if((a + b) > (c + d))  printf("Left\n");
		else if ((a + b) < (c + d))  printf("Right\n");
		else if((a + b) == (c + d))  printf("Balanced\n");
	}
}

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

#include <iostream>
using namespace std;
int main()
{
	int A, B, C, D;
	cin >> A >> B >> C >> D;
	if (A + B < C + D)
		cout << "Right";
	if(A + B = C + D)
		cout << "Balanced";
	if (A + B > C + D)
		cout << "Left";
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:14: error: lvalue required as left operand of assignment
    9 |         if(A + B = C + D)
      |            ~~^~~
Language: C++

#include <iostream>
using namespace std;
int main()
{
	int A, B, C, D;
	cin >> A >> B >> C >> D;
	if (A + B < C + D)
		cout << "Right\n";
	if(A + B = C + D)
		cout << "Balanced\n";
	if (A + B > C + D)
		cout << "Left\n";
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:14: error: lvalue required as left operand of assignment
    9 |         if(A + B = C + D)
      |            ~~^~~
Language: C++

a,b,c,d=[int(x) for x in input().split()]
if a+b>c+d:print("Left")
elif a+b<c+d:print("Right")
else:print("Balanced")

Compiler output:
a.cc:1:1: error: 'a' does not name a type
    1 | a,b,c,d=[int(x) for x in input().split()]
      | ^
Language: Java

public class Libra{
	
	public static void main(String[] args){
		int a = Integer.valueOf(args[0]);
		int b = Integer.valueOf(args[1]);
		int c = Integer.valueOf(args[2]);
		int d = Integer.valueOf(args[3]);

		if (a+b>c+d){
			System.out.println("Left");
		}else if(a+b<c+d){
			System.out.println("Right");
		}else{
			System.out.println("Balanced");
		}
	}
	
	
}

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

////////////////////////////////////////////////
//                                            //
//  Author: Muhammad Faishol Amirul Mukminin  //
//                                            //
////////////////////////////////////////////////
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair pi;
typedef pair pii;
typedef pair pl;
typedef pair pll;
typedef pair pd;
typedef pair pdd;

#define fi first
#define se second
#define PUB push_back
#define POB pop_back
#define PUF push_front
#define POF pop_front
#define ALL(v) (v).begin(),(v).end()
#define endl "\n"

const double EPS = 1e-9;
const double PI = acos(-1);

const ll MOD = 1e9+7;

const int dCol[] = {0,+1,0,-1,+1,+1,-1,-1};
const int dRow[] = {-1,0,+1,0,-1,+1,+1,-1};

ll A, B, N, ans=0;

bool valid(ll ang){
	ll res=0;
	while(ang>0){
		res += ang%10;
		ang/=10;
	}

	if(A <= ang && ang <= B) return 1;
	else return 0;
}

int main(){
	ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	
	cin >> N >> A >> B;
	FORN(i,1,N){
		if(valid(i)) ans += i;
	}
	cout << i << endl;
	return 0;
}


Compiler output:
a.cc:11:9: error: typedef declared 'auto'
   11 | typedef pair pi;
      |         ^~~~
a.cc:12:9: error: typedef declared 'auto'
   12 | typedef pair pii;
      |         ^~~~
a.cc:13:9: error: typedef declared 'auto'
   13 | typedef pair pl;
      |         ^~~~
a.cc:14:9: error: typedef declared 'auto'
   14 | typedef pair pll;
      |         ^~~~
a.cc:15:9: error: typedef declared 'auto'
   15 | typedef pair pd;
      |         ^~~~
a.cc:16:9: error: typedef declared 'auto'
   16 | typedef pair pdd;
      |         ^~~~
a.cc: In function 'int main()':
a.cc:52:14: error: 'i' was not declared in this scope; did you mean 'pi'?
   52 |         FORN(i,1,N){
      |              ^
      |              pi
a.cc:52:9: error: 'FORN' was not declared in this scope
   52 |         FORN(i,1,N){
      |         ^~~~
Language: C++

#include <iostream>
using namespace std;
int main()
{
	int A, B, C, D;
	cin >> A >> B >> C >> D;
	if (A + B < C + D)
		cout << "Right\n";
	else if(A + B = C + D)
		cout << "Balanced\n";
	else
		cout << "Left\n";
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:19: error: lvalue required as left operand of assignment
    9 |         else if(A + B = C + D)
      |                 ~~^~~
Language: C++

#include<stdio.h>
int a,b,c,d;
int main (){
	scanf("%d %d %d %d",&a,&b,&c,&d);
  	if(a+b>c+d){
      	printf("Left");
    }else if(a+b==c+d){
      	printf("Balanced");
    }else if(a+b<c+d)}
      	printf("Right");
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:22: error: expected primary-expression before '}' token
    9 |     }else if(a+b<c+d)}
      |                      ^
a.cc: At global scope:
a.cc:10:15: error: expected constructor, destructor, or type conversion before '(' token
   10 |         printf("Right");
      |               ^
a.cc:11:1: error: expected declaration before '}' token
   11 | }
      | ^
a.cc:12:1: error: expected unqualified-id before 'return'
   12 | return 0;
      | ^~~~~~
a.cc:13:1: error: expected declaration before '}' token
   13 | }
      | ^
Language: C++

#include <iostream>
using namespace std;
int main()
{
	int A, B, C, D;
	cin >> A >> B >> C >> D;
	if (A + B < C + D)
		cout << "Right\n";
	else (A + B = C + D)
		cout << "Balanced\n";
	else
		cout << "Left\n";
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:17: error: lvalue required as left operand of assignment
    9 |         else (A + B = C + D)
      |               ~~^~~
a.cc:11:9: error: 'else' without a previous 'if'
   11 |         else
      |         ^~~~
Language: C++

#include<iostream>

int main(){
	int a,b,c,d;
	cin >> a >> b >> c >> d;
	
	int left = a+b,right = c+d;
	
	if(left == right){
		cout << "Balanced" << endl;
	}
	else if(left > right){
		cout << "Left" << endl;
	}
	else{
		cout << "Right" << endl;
	}
	
	return 0
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |         cin >> a >> b >> c >> d;
      |         ^~~
      |         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:10:17: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   10 |                 cout << "Balanced" << endl;
      |                 ^~~~
      |                 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:39: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   10 |                 cout << "Balanced" << endl;
      |                                       ^~~~
      |                                       std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:13:17: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   13 |                 cout << "Left" << endl;
      |                 ^~~~
      |                 std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:13:35: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   13 |                 cout << "Left" << endl;
      |                                   ^~~~
      |                                   std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:16:17: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   16 |                 cout << "Right" << endl;
      |                 ^~~~
      |                 std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:16:36: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   16 |                 cout << "Right" << endl;
      |                                    ^~~~
      |                                    std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:19:17: error: expected ';' before '}' token
   19 |         return 0
      |                 ^
      |                 ;
   20 | }
      | ~
Language: C++

#include<stdio.h>
int a,b,c,d;
int main (){
	scanf("%d %d %d %d",&a,&b,&c,&d);
  	if(a+b>c-d){
      	printf("Left");
    }else if(a+b==c+d){
      	printf("Balanced");
    }else if(a+b<c+d)}
      	printf("Right");
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:22: error: expected primary-expression before '}' token
    9 |     }else if(a+b<c+d)}
      |                      ^
a.cc: At global scope:
a.cc:10:15: error: expected constructor, destructor, or type conversion before '(' token
   10 |         printf("Right");
      |               ^
a.cc:11:1: error: expected declaration before '}' token
   11 | }
      | ^
a.cc:12:1: error: expected unqualified-id before 'return'
   12 | return 0;
      | ^~~~~~
a.cc:13:1: error: expected declaration before '}' token
   13 | }
      | ^
Language: C++

#include<stdio.h>
int a,b,c,d;
int main (){
	scanf("%d %d %d %d",&a,&b,&c,&d);
  	if(a+b>c-d){
      	printf("Left");
    }else if(a+b==c+d){
      	prntf("Balanced");
    }else if(a+b<c+d)}
      	printf("Right");
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'prntf' was not declared in this scope; did you mean 'printf'?
    8 |         prntf("Balanced");
      |         ^~~~~
      |         printf
a.cc:9:22: error: expected primary-expression before '}' token
    9 |     }else if(a+b<c+d)}
      |                      ^
a.cc: At global scope:
a.cc:10:15: error: expected constructor, destructor, or type conversion before '(' token
   10 |         printf("Right");
      |               ^
a.cc:11:1: error: expected declaration before '}' token
   11 | }
      | ^
a.cc:12:1: error: expected unqualified-id before 'return'
   12 | return 0;
      | ^~~~~~
a.cc:13:1: error: expected declaration before '}' token
   13 | }
      | ^
Language: C++

#include <iostream>
 
using namespace std;
 
int main(){
  int a,b,c,d;cin>>a>>b>>c>>d;
  if(a+b==c+d)cout<<"Balanced\n";
  else if(a+b>c+d)cout<<"Left\n";
  else cout<<"Right\n";
  return 0;

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

#include<stdio.h>

void main(void){
	int a,b,c,d;
	int l,r;
	
	scanf("%d %d %d %d",&a,&b,&c,&d);

	l = a + b;
	r = c + d;

	if (l>r){
		printf("Left\n");
	}
	else if(l<r){
		printf("Right\n");
	}
	else{
		printf("Balanced\n");
	}

}

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

#include<Stdio.h>
int a,b,c,d;
int main (){
	scanf("%d %d %d %d",&a,&b,&c,&d);
  	if(a+b>c-d){
      	printf("Left");
    }else if(a+b==c+d){
      	prntf("Balanced");
    }else if(a+b<c+d)}
      	printf("Right");
}
return 0;
}

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

#include <bits/stdc++.h>
using namespace std;
 
int main(){
	int a,b,c,d; 
	cin >> a >> b >> c >> d;
	if((a + b) > (c + d)){
		cout << "Left" << endl;
	}elseif((a + b) < (c + d)){
		cout << "Right" << endl;
	}else{
		cout << "Balanced" << endl;
	}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:10: error: 'elseif' was not declared in this scope
    9 |         }elseif((a + b) < (c + d)){
      |          ^~~~~~
a.cc:11:10: error: 'else' without a previous 'if'
   11 |         }else{
      |          ^~~~
Language: Java

import java.util.*;

public class Libra {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();
    int c = sc.nextInt();
    int d = sc.nextInt();
    int l = a + b;
    int r = c + d;

    if(l > r) {
      System.out.println("Left");
    } else if(l < r) {
      System.out.println("Right");
    } else {
      System.out.println("Balanced");
    }
  }
}


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


import java.util.Scanner;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author rn-sshawish
 */
public class Atcoder83A {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int left = input.nextInt() + input.nextInt();
        int right =  input.nextInt() + input.nextInt();
        if (left > right) {
            System.out.println("Left");
        }else if (left < right) {
            System.out.println("Right");
        }else{
            System.out.println("Balanced");
        }
    }
}


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

#include<bits/stdc++.h>

using namespace std;

int main(){
	int a, b, c, d;
	scanf("%d %d %d %d", &a, &b, &c, %d);
	int x = a + b, y = c + d;
	if(x < y) printf("Left\n");
	else if (x == y) printf("Balanced\n");
	else printf("Right\n");
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:42: error: expected primary-expression before '%' token
    7 |         scanf("%d %d %d %d", &a, &b, &c, %d);
      |                                          ^
Language: C

#include <stdio.h>

int main(){
  int a, b, c, d;
  scanf("%d%d%d%d", &a, &b, &c, &d);
  int x = a + b - c - d;
  if(x > 0) {
    puts("Left");
  }else(x==0) {
    puts("Balanced");
  }else{
    puts("Right");
  }
}

Compiler output:
main.c: In function 'main':
main.c:9:14: error: expected ';' before '{' token
    9 |   }else(x==0) {
      |              ^~
      |              ;
Language: C++

#include <bits/stdc++.h>
#define ll long long
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 100000005
#define MAX 100001
#define fi first
#define se second
using namespace std;
//__gcd(a,b), __builtin_popcount(a);

int main(){
	int a[4];
	rep(i, n)scanf("%d", &a[i]);
	if(a[0]+a[1] > a[2]+a[3])printf("Left");
	else if(a[0]+a[1] < a[2]+a[3])printf("Right");
	else printf("Balanced");
	printf("\n");
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:16: error: 'n' was not declared in this scope
   13 |         rep(i, n)scanf("%d", &a[i]);
      |                ^
a.cc:3:32: note: in definition of macro 'rep'
    3 | #define rep(i,n) for(int i=0;i<n;i++)
      |                                ^
Language: C++

#include<iostream>
using namespace std;

main(){
  int a,b,c,d;
  cin >> a >> b >> c >> d;
  a+=b;
  c+=d;

  if(a>c)
    cout << "Left" << endl;
  if(a<c)
    cout << "Right" << endl;
  if(a==c)
    cotu << "Balanced" << endl;

  return (0);
}

Compiler output:
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    4 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:15:5: error: 'cotu' was not declared in this scope
   15 |     cotu << "Balanced" << endl;
      |     ^~~~
Language: C

#include<stdio.h>

int main(){
	int a,b,c,d;
	int N,A,B;
	long logn int total=0;
	
	scanf("%d %d %d", &N, &A, &B);
	
	for(int i=1; i<=N; i++){
	
		a=i/1000; 
		b=(i/100)%10;
		c=(i/10)%10;
		d=i%10;
		
		int hasil=a+b+c+d;
		
		if(hasil >=A && hasil <=B){
			total+=i;
		
		}
	}
	printf("%lld", total);
}

Compiler output:
main.c: In function 'main':
main.c:6:18: error: expected ';' before 'int'
    6 |         long logn int total=0;
      |                  ^~~~
      |                  ;
Language: C++

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

int main(){
  int n,a,b;
  cin >> n >> a >> b;
  int res = 0;
  for(int i = 1; i <= n; ++i){
    if(check(i,a,b)){
      res += i;
    }
  }
  cout << res;
}

bool check(int p,int x,int y){
  int c = 0;
  while(p > 0){
    c += p % 10;
    p /= 10;
  }
  if(x <= c && c <= y){
    return true;
  }
  return false;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:8: error: 'check' was not declared in this scope
    9 |     if(check(i,a,b)){
      |        ^~~~~
Language: C++

#include <iostream>
using namespace std;

int sumOfDigits(int i) {
	int sum = 0;
	while (i > 0) {
		sum += (i % 10);
		i /= 10;
	}
	return sum;
}

void main() {
	int n, a, b;
	int sum = 0;
	cin >> n >> a >> b;
	for (int i = 1; i <= n; i++) {
		int tmp = sumOfDigits(i);
		if (a <= tmp && tmp <= b) {
			sum += i;
		}
	}
	cout << sum << endl;
}

Compiler output:
a.cc:13:1: error: '::main' must return 'int'
   13 | void main() {
      | ^~~~
Language: Java

import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a = sc.nextInt();
      	int b = sc.nextInt();
		int sho = 0;
      	int amrs = 0;
	    int ans = 0;
      
      for(int i = 1 ; i < n+1 ; i++){
        sho = i;
        amrS= 0;
      	while(sho != 0){
          amrS += sho%10;
          sho /= 10;
        }  
        if(amrS >= a && amrS <= b){
        	ans += i; 
        }  
      }
                  System.out.println(ans);
    }
}


Compiler output:
Main.java:15: error: cannot find symbol
        amrS= 0;
        ^
  symbol:   variable amrS
  location: class Main
Main.java:17: error: cannot find symbol
          amrS += sho%10;
          ^
  symbol:   variable amrS
  location: class Main
Main.java:20: error: cannot find symbol
        if(amrS >= a && amrS <= b){
           ^
  symbol:   variable amrS
  location: class Main
Main.java:20: error: cannot find symbol
        if(amrS >= a && amrS <= b){
                        ^
  symbol:   variable amrS
  location: class Main
4 errors
Language: Java

import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a = sc.nextInt();
      	int b = sc.nextInt();
		int sho, amrs;
	    int ans = 0;
      for(int i = 1 ; i < n+1 ; i++){
        sho = i;
        amrS= 0;
      	while(sho != 0){
          sho /= 10;
          amrS += sho%10;
        }  
        if(amrS >= a && amrS <= b){
        	ans += i; 
        }  
      }
                  System.out.println(ans);
    }
}


Compiler output:
Main.java:13: error: cannot find symbol
        amrS= 0;
        ^
  symbol:   variable amrS
  location: class Main
Main.java:16: error: cannot find symbol
          amrS += sho%10;
          ^
  symbol:   variable amrS
  location: class Main
Main.java:18: error: cannot find symbol
        if(amrS >= a && amrS <= b){
           ^
  symbol:   variable amrS
  location: class Main
Main.java:18: error: cannot find symbol
        if(amrS >= a && amrS <= b){
                        ^
  symbol:   variable amrS
  location: class Main
4 errors
Language: Java

import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a = sc.nextInt();
      	int b = sc.nextInt();
		int sho amrs;
	    int ans = 0;
      for(int i = 1 ; i < n+1 ; i++){
        sho = i;
        amrS= 0;
      	while(sho != 0){
          sho /= 10;
          amrS += sho%10;
        }  
        if(amrS >= a && amrS <= b){
        	ans += i; 
        }  
      }
                  System.out.println(ans);
    }
}


Compiler output:
Main.java:9: error: ';' expected
		int sho amrs;
		       ^
Main.java:9: error: not a statement
		int sho amrs;
		        ^
2 errors
Language: Java

import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a = sc.nextInt();
      	int b = sc.nextInt();
      	int amrS= 0;
        int sho = 0:
	    int ans = 0;
      for(int i = 1 ; i < n+1 ; i++){
        sho = i;
        amrS= 0;
      	while(i != 0){
          sho = i/10;
          amrS = amrS + i%10;
        }  
        if(amrS >= a && amrS <= b){
        	ans += i; 
        }  
      }
                  System.out.println(ans);
    }
}


Compiler output:
Main.java:10: error: ';' expected
        int sho = 0:
                   ^
1 error
Language: Java

import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a = sc.nextInt();
      	int b = sc.nextInt();
      	int amrS= 0;
        int sho = 0:
	    int ans = 0;
      for(int i = 1 ; i < n+1 ; i++){
        sho = i;
        amrS= 0
      	while(i != 0){
          sho = i/10;
          amrS = amrS + i%10;
        }  
        if(amrS >= a && amrS <= b){
        	ans += i; 
        }  
      }
                  System.out.println(ans);
    }
}


Compiler output:
Main.java:10: error: ';' expected
        int sho = 0:
                   ^
Main.java:14: error: ';' expected
        amrS= 0
               ^
2 errors
Language: Java

import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a = sc.nextInt();
      	int b = sc.nextInt();
      	int sho = 1;
      	int amr = 0;
      	int amrS= 0;
      int ans = 0;
      for(int i = 1 ; i < n+1 ; i++){
      	while(sho){
          sho = i/10;
          amrS = amrS + i%10;
        }  
        if(amrS >= a && amrS <= b){
        	ans += i; 
        }  
      }
                  System.out.println(ans);
    }
}


Compiler output:
Main.java:14: error: incompatible types: int cannot be converted to boolean
      	while(sho){
      	      ^
1 error
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main() {
    int N, A, B;
    cin >> N >> A >> B;
    int rel = 0;

    for (int i  = 1; i <= N; i++) {
        int j = i;
        int sum = 0;
        while(i > 0) {
            if (i / 10 != 0) {
                sum += i % 10;
                i /= 10;
        }

        if (sum >= A && sum <= B) {
            rel += j;
        }
    }

    cout << rel << endl;
}

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

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

int main() {
	int N, A, B; std::cin >> N >> A >> B;
	long long ans = 0;
	for (int i = 1; i <= N; ++i) {
		int all = i / 10000
			+ i % 10000
			+ i % 1000 - ((i % 10000) * 10)
			+ i % 100 - ((i % 1000) * 10) - ((i % 10000) * 100)
			+ i % 10 - ((i % 100) * 10) - ((i % 1000) * 100) - ((i % 10000) * 1000);
		if (A <= all && all <= B) ans += i;
	}
	std::cout << i << std::endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:22: error: 'i' was not declared in this scope
   20 |         std::cout << i << std::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,A,B;
    cin >> N >> A >> B;
    int sum = 0;

    for (int i = 1; i <= N; i++){
      int n = findSumOfDigits(i)
      if(n >= A && n <=B){
        sum += i;
      }
    }

    cout << sum << endl;

    }


Compiler output:
a.cc: In function 'int main()':
a.cc:21:7: error: expected ',' or ';' before 'if'
   21 |       if(n >= A && n <=B){
      |       ^~
Language: C++

#include <iostream>
using namespace std;

int main() {
    // 入力
    int N,A,B;
    cin >> N >> A >> B;
    int sum = 0;

    for (int i = 1; i <= N; i ++){
      ju = (i/10)%10;
      iti = i%10;

      if(ju + iti >= A && ju + iti <=B){
        sum += i;
      }
    }
    cout << sum << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:7: error: 'ju' was not declared in this scope
   11 |       ju = (i/10)%10;
      |       ^~
a.cc:12:7: error: 'iti' was not declared in this scope
   12 |       iti = i%10;
      |       ^~~
Language: C++

#include <iostream>
using namespace std;

int main() {
    // 入力
    int N,A,B;
    cin >> N >> A >> B;
    int total = 0;

    int sum = 0;

    for (int i = 0; i < N; i++){
      while (i > 0) { // n が 0 になるまで
        sum += i % 10;
        i /= 10;
        if(sum >= A && sum <=B){
          total += i;
        }
    }


    cout << total << endl;
}


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

#include <iostream>
using namespace std;

int main() {
    // 入力
    int N,A,B;
    cin >> N >> A >> B;
    int sum = 0;
    int ju = 0;
    int iti = 0;

    for (int i = 0; i <= N; i ++){
      ju = i/10;
      iti = i%10;
      int total = 0;
      total = ju + iti
      if(total >= A && total <=B){
        sum += i;
      }
    }
    cout << sum << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:23: error: expected ';' before 'if'
   16 |       total = ju + iti
      |                       ^
      |                       ;
   17 |       if(total >= A && total <=B){
      |       ~~
Language: C++

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

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

int main() {
  int N, A, B;
  cin >> N >> A >> B;
  
  int answer = 0;
  
  while (true) {
    
    int count = 0;
    for (int i = 1; i < N; i++) {
      int sim = sum(i);
      
      if (sim >= A && sim <= B) {
        answer += i;
      }
    }
  }
}

Compiler output:
a.cc: In function 'int sum(int)':
a.cc:8:9: warning: pointer to a function used in arithmetic [-Wpointer-arith]
    8 |     sum += n % 10;
      |     ~~~~^~~~~~~~~
a.cc:8:9: error: assignment of read-only location 'sum'
a.cc:11:1: warning: no return statement in function returning non-void [-Wreturn-type]
   11 | }
      | ^
Language: C++

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

int sum() {
  int sim = 0;
  
  while (0 < n) {
    sum += n % 10;
    n /= 10;
  }
}

int main() {
  int N, A, B;
  cin >> N >> A >> B;
  
  int answer = 0;
  
  while (true) {
    
    int count = 0;
    for (int i = 1; i < N; i++) {
      int sim = sum(i);
      
      if (sim >= A && sim <= B) {
        answer += i;
      }
    }
  }
}

Compiler output:
a.cc: In function 'int sum()':
a.cc:7:14: error: 'n' was not declared in this scope; did you mean 'yn'?
    7 |   while (0 < n) {
      |              ^
      |              yn
a.cc:11:1: warning: no return statement in function returning non-void [-Wreturn-type]
   11 | }
      | ^
a.cc: In function 'int main()':
a.cc:23:20: error: too many arguments to function 'int sum()'
   23 |       int sim = sum(i);
      |                 ~~~^~~
a.cc:4:5: note: declared here
    4 | int sum() {
      |     ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(void)
{
  long long int n,a,b,sum=0,number;
  cin >> n >> a >> b;
  for(i=0;i<=n;i++)
  {
    number = 0;
    for(j=0;j<5;j++)
    {
     number += n % 10;
     number /= 10
    }
    if(a <= number && number <= b)
    {
      sum += n;
    }
  }
  cout << sum;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:7: error: 'i' was not declared in this scope
    7 |   for(i=0;i<=n;i++)
      |       ^
a.cc:10:9: error: 'j' was not declared in this scope
   10 |     for(j=0;j<5;j++)
      |         ^
a.cc:13:18: error: expected ';' before '}' token
   13 |      number /= 10
      |                  ^
      |                  ;
   14 |     }
      |     ~
Language: C++

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

int main(){
  int n,A,B;
  cin >> n >> A >> B;
  int ans=0;
  for(int i=1;i<=n;i++){
    int sum=0;
    int x=i;
    for(int j=0;j<5;j++){
      sum+= x%10;
      x/=10;
    }
    if(A <= sum && sum <=B){
      ans += i;
    }
    cout << ans;
    return 0;
  }

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

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

int main(){
  int n,a,b;
  cin >> n >> a >> b;
  int ans=0;
  for(int i=1;i<=n;i++){
    int sum=0;
    int x=i;
    for(int j=0;j<5;j++){
      sum+= x%10;
      x/=10;
    }
    if(A <= sum && sum <=B){
      ans += i;
    }
    cout << ans;
    return 0;
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:15:8: error: 'A' was not declared in this scope
   15 |     if(A <= sum && sum <=B){
      |        ^
a.cc:15:26: error: 'B' was not declared in this scope
   15 |     if(A <= sum && sum <=B){
      |                          ^
a.cc:20:4: error: expected '}' at end of input
   20 |   }
      |    ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

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

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

int main(){
  int N,A,B;
  cin >> N >> A >> B;
  int total =0;
  for(int i=0;i<=N;i++){
   int i = p(i);
   if(i>=A && i <=B){
    total++;
   }
  cout << total << endl;
  } 
}

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'spacename'
    2 | using spacename std;
      |       ^~~~~~~~~
a.cc: In function 'int p(int)':
a.cc:11:10: error: 'sum' was not declared in this scope
   11 |   return sum;
      |          ^~~
a.cc: In function 'int main()':
a.cc:16:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   16 |   cin >> N >> A >> B;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:19:8: error: redeclaration of 'int i'
   19 |    int i = p(i);
      |        ^
a.cc:18:11: note: 'int i' previously declared here
   18 |   for(int i=0;i<=N;i++){
      |           ^
a.cc:23:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   23 |   cout << total << endl;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:23:20: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   23 |   cout << total << endl;
      |                    ^~~~
      |                    std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<iostream>
using namespace std;
int digit(int n){
  int a=0;
  while(n!=0){
    a+=n%10;
    n=n/10;
  }
  return a;
}
int main(){
  int n,a,b,i;
  cin >> n >> a >> b;
  int a=0;
  for(i=0;i<=0;i++){
    if(digit(i)>=a && digit(i )<=b){
      a+=i;
    }
  }
  cout << a << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:7: error: redeclaration of 'int a'
   14 |   int a=0;
      |       ^
a.cc:12:9: note: 'int a' previously declared here
   12 |   int n,a,b,i;
      |         ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int digit(int n){
  int ans=0;
  while(n!=0){
    ans+=n%10;
    n=n/10;
  }
    return ans;
}
int main(){
  int n,a,b;
  cin >> n >> a >> b;
  int ans=0;
  for(i=1;i<n;i++){
    if (digit(i)>=a && digit(i)<=b){
      ans+=i;
    }
  }
  cout << ans << endl;
}

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

#include<bits/stdc++.h>
using namespace std;
int digit(int n){
  int ans=0;
  while(n!=0){
    ans+=n%10;
    n=n/10;
  }
  return ans;
}
int main(){
  int n,a,b,i;
  cin >> n >> a >> b;
  int ans=0;
  for(i=1;i<=n;i++){
    if(bigit(i)>=a && bigit(i)<=b){
      ans+=i
    }
  } 
  cout << ans <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:8: error: 'bigit' was not declared in this scope; did you mean 'digit'?
   16 |     if(bigit(i)>=a && bigit(i)<=b){
      |        ^~~~~
      |        digit
a.cc:17:13: error: expected ';' before '}' token
   17 |       ans+=i
      |             ^
      |             ;
   18 |     }
      |     ~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int digit(int n){
  int ans=0;
  while(n!=0){
    ans+=n%10;
    n=n/10;
  }
  int n,a,b;
  cin >> n >> a >> b;
  int ans=0;
  for(i=1;i<n;i++){
    if (digit(i)>=a && digit(i)<=b){
      ans+=i;
    }
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int digit(int)':
a.cc:9:7: error: declaration of 'int n' shadows a parameter
    9 |   int n,a,b;
      |       ^
a.cc:3:15: note: 'int n' previously declared here
    3 | int digit(int n){
      |           ~~~~^
a.cc:11:7: error: redeclaration of 'int ans'
   11 |   int ans=0;
      |       ^~~
a.cc:4:7: note: 'int ans' previously declared here
    4 |   int ans=0;
      |       ^~~
a.cc:12:7: error: 'i' was not declared in this scope
   12 |   for(i=1;i<n;i++){
      |       ^
a.cc:18:1: warning: no return statement in function returning non-void [-Wreturn-type]
   18 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll =long long;
#define all(v) v.begin(),v.end()
 
int main() {
ll N,A,B;
  cin>>N>>A>>B;
  ll ans=0;
  for(ll i=1;i<=N;i++) {
string S=stoll(i);
    ll count=0;
    for(auto x:S) {
count+=x-'0';
    }
    if(count>=A&&count<=B) {
ans++;
    }
  }
  
  
  cout<<ans<<endl;
}

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

#include <bits/stdc++.h>
#include <cstdio>

using namespace std;
int main() {
  int N,A,B;
  int count = 0;
  int keep,sum = 0;
  int i;
  cin >> N >> A >> B;
  for (i = 0; i < N; i++) { 
    // Digit calculation
    i = y;
    while(y < 0){
      keep = y % 10;
      y = y / 10;
    }
    if (A <= keep && keep <= B){
      sum += keep; 
    }
  }
  cout << sum;
}

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

#include <bits/stdc++.h>
#include <cstdio>

using namespace std;
int main() {
  int N,A,B;
  int count = 0;
  int keep,sum = 0;
  int i;
  int count = 0;
  cin >> N >> A >> B;
  for (i = 0; i < N; i++) { 
    // Digit calculation
    i = y;
    while(y < 0){
      keep = y % 10;
      y = y / 10;
    }
    if (A <= keep && keep <= B){
      sum += keep; 
    }
  }
  cout << sum;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:7: error: redeclaration of 'int count'
   10 |   int count = 0;
      |       ^~~~~
a.cc:7:7: note: 'int count' previously declared here
    7 |   int count = 0;
      |       ^~~~~
a.cc:14:9: error: 'y' was not declared in this scope
   14 |     i = y;
      |         ^