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

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

#define MAX(a,b) (a > b ? a : b)
#define MIN(a,b) (a < b ? a : b)
const int inf = 1000000000; // 10^9
int sum(int x){
   int _sum = 0;
   for(int i = 100000;i > 0;i/=10){_sum += x / i;x-=_sum*i;}
   return _sum;
}
int main(){
   int n,a,b;scanf("%d%d%d",&n,&a,&b);
   long int ans=0;
   for(int i = 1;i <= n;i++){
      int _sum = 0;
      for(int i = 100000;i > 0;i/=10){_sum += x / i;x-=_sum*i;}
      if((_sum>=a)&&(_sum<=b)){
         ans+=i;
         //printf("%d\n",i);
      }
   }
   printf("%ld\n",ans);
   return 0;
}

Compiler output:
main.c: In function 'main':
main.c:18:47: error: 'x' undeclared (first use in this function)
   18 |       for(int i = 100000;i > 0;i/=10){_sum += x / i;x-=_sum*i;}
      |                                               ^
main.c:18:47: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

// 各桁の和を計算する関数
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 total = 0;
  for (int i = 1; i <= N; ++i) {
    int sum = findSumOfDigits(i); // i の各桁の和
    if (sum >= A && sum <= B) { //  i の各桁の和が A 以上 B 以下かどうか
      total += i;
    }
  }
  cout << total << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:3: error: 'cin' was not declared in this scope
   13 |   cin >> N >> A >> B;
      |   ^~~
a.cc:21:3: error: 'cout' was not declared in this scope
   21 |   cout << total << endl;
      |   ^~~~
a.cc:21:20: error: 'endl' was not declared in this scope
   21 |   cout << total << endl;
      |                    ^~~~
Language: C++

N, A, B = map(int, input().split())
ans = 0
for num in range(1, N+1):
    s = sum(ord(c) - ord('0') for c in str(num))
    if A <= s and s <= B: ans += num
print(ans)


Compiler output:
a.cc:1:1: error: 'N' does not name a type
    1 | N, A, B = map(int, input().split())
      | ^
Language: C++

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

int main(){
  int n,a,b;
  cin>>n>>a>>b;
  int num=0,sum=0;
  for (int i = 1; i <=n; i++)
  {
    /* code */
    t=i;
    for (int j = 0; j <5; j++)
    {
      /* code */
      num+=t%10,t/=10;
    }
    
    if (num>=a&&num<=b)
    {
      /* code */
      sum+=i;
    }
    num=0;
    
  }
  cout<<sum<<endl;
  
  }

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

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

int main() {
  int N, A, B;
  cin >> N >> A >> B;
  int sum;
  vector<int> num(N);
  for (int i = 0; i < N; i++) {
  for (int j = 0; i >= std::pow(10, j); j++){
    num.at(i) += i / std::pow(10, j);
    }
  if (A =< num.at(i) =< B) {
    count += i;
  }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:10: error: expected primary-expression before '<' token
   13 |   if (A =< num.at(i) =< B) {
      |          ^
a.cc:13:23: error: expected primary-expression before '<' token
   13 |   if (A =< num.at(i) =< B) {
      |                       ^
a.cc:14:14: error: overloaded function with no contextual type information
   14 |     count += i;
      |              ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
typedef long long ll;
int waru10(int n){
  while(n){
    sum+=n%10;
    n/=10;
  }
  return sum;
}
int main()	{
  int n,a,b;
  int sum;
  int am=0;
  sum=waru10(n);
  rep(i,n){
  if(a<=sum && sum<=b)
    am+=i;
  }
  cout<<am<<endl;
}

Compiler output:
a.cc: In function 'int waru10(int)':
a.cc:9:5: error: 'sum' was not declared in this scope
    9 |     sum+=n%10;
      |     ^~~
a.cc:12:10: error: 'sum' was not declared in this scope
   12 |   return sum;
      |          ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=1;i<=(int)(n);i++)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
typedef long long ll;
int main()	{
  int n,a,b;
  int num=0;
  int sum=0;
  cin>>n>>a>>b;
  rep(i,n){
     while(n>0){
    num+=n%10;
    n/=10;
  }
  rep(i,n){
    if(a<=num && num<=b){
      sum+=i;
    }
  }
  cout<<sum<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:2: error: expected '}' at end of input
   23 | }
      |  ^
a.cc:7:17: note: to match this '{'
    7 | 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 tmp=i/1000 + i%1000/100 + i%100/10 + i%10;
    if(tmp>=A && tmp<=B){
      ans++;
    }
  }
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:12: error: expected ',' or ';' before ':' token
    8 |   int ans=0:
      |            ^
a.cc:9:16: error: 'i' was not declared in this scope
    9 |   for(int i=1; i<=N; i++){
      |                ^
Language: C++

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

int main(){
  int n,a,b;
  cin >> n >> a >> b;
  int total =0;
    
  for(int i=;i<=n;i++){
    string s = i;
    int sum =0;
    for(int j=0;j<s.size();j++){
      sum += s.at(j);
    }
    if(a <=sum && sum <= b){
      total += i;
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:13: error: expected primary-expression before ';' token
    9 |   for(int i=;i<=n;i++){
      |             ^
a.cc:10:16: error: conversion from 'int' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
   10 |     string s = i;
      |                ^
Language: C++

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

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

int main() {
    int n;
    cin >> n >> m;
    int ans = 0;
    rep2(i,1,n+1) {
        if(a <= digit_sum(i) && digit_sum(i) <= b) ans += i;
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:17: error: 'm' was not declared in this scope
   20 |     cin >> n >> m;
      |                 ^
a.cc:23:12: error: 'a' was not declared in this scope
   23 |         if(a <= digit_sum(i) && digit_sum(i) <= b) ans += i;
      |            ^
a.cc:23:49: error: 'b' was not declared in this scope
   23 |         if(a <= digit_sum(i) && digit_sum(i) <= b) ans += i;
      |                                                 ^
Language: C++

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

int main() {
  int N,A,B;
  cin >>N>>A>>B;
  int c=1;
  int ans=0;
  for(int i =0;i<N;i++){
    if(i%10+(i%100-i%10)/10+(i%1000-i%100)/100+(i%10000-i%1000)/1000+(i%100000-i%10000)/10000)>=A){
      c+=1;
    }
    if(i%10+(i%100-i%10)/10+(i%1000-i%100)/100+(i%10000-i%1000)/1000+(i%100000-i%10000)/10000)<=B){
      c+=1;
    }
    if(c==3){
      ans+=1;
    }
  }
  cout <<ans<<endl;
  
      
      
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:95: error: expected primary-expression before '>=' token
   10 |     if(i%10+(i%100-i%10)/10+(i%1000-i%100)/100+(i%10000-i%1000)/1000+(i%100000-i%10000)/10000)>=A){
      |                                                                                               ^~
a.cc:13:95: error: expected primary-expression before '<=' token
   13 |     if(i%10+(i%100-i%10)/10+(i%1000-i%100)/100+(i%10000-i%1000)/1000+(i%100000-i%10000)/10000)<=B){
      |                                                                                               ^~
Language: C++

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

int main() {
  int N,A,B;
  cin >>N>>A>>B;
  int c=1;
  int ans=0;
  for(int i =A;i<N;i++){
    if(i%10+(i%100-i%10)/10+(i%1000-i%100)/100+(i%10000-i%1000)/1000+(i%100000-i%10000)/10000)>=A){
      c+=1;
    }
    if(i%10+(i%100-i%10)/10+(i%1000-i%100)/100+(i%10000-i%1000)/1000+(i%100000-i%10000)/10000)<=B){
      c+=1;
    }
    if(c==3){
      ans+=1;
    }
  }
  cout <<ans<<endl;
  
      
      
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:95: error: expected primary-expression before '>=' token
   10 |     if(i%10+(i%100-i%10)/10+(i%1000-i%100)/100+(i%10000-i%1000)/1000+(i%100000-i%10000)/10000)>=A){
      |                                                                                               ^~
a.cc:13:95: error: expected primary-expression before '<=' token
   13 |     if(i%10+(i%100-i%10)/10+(i%1000-i%100)/100+(i%10000-i%1000)/1000+(i%100000-i%10000)/10000)<=B){
      |                                                                                               ^~
Language: C++

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

int dsum(int n) {
  int sm = 0;
  while (n>0) {
    sm += n%10;
    n /= 10;
  }
  return dsum;
}
int main() {
  int n,a,b;cin>>n>>a>>b;
  int cnt=0,d;
  rep(i,n) {
    d = dsum(i+1);
    if (d >= a && d <= b) cnt++;
  }
  cout << cnt;
}


Compiler output:
a.cc: In function 'int dsum(int)':
a.cc:11:10: error: invalid conversion from 'int (*)(int)' to 'int' [-fpermissive]
   11 |   return dsum;
      |          ^~~~
      |          |
      |          int (*)(int)
Language: C++

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


int help(int tmp){
  int ans = 0;
    while(tmp>0){
       ams+=tmp%10;
       tmp/=10;
    }
  return ans ;
}

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

  int answer,tmp;
  answer = 0;
  for(int i=1;i<n;++i){
    tmp=help(i);
    if(tmp<=b && tmp>=a) answer+=tmp;
  }

  cout << answer << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int help(int)':
a.cc:9:8: error: 'ams' was not declared in this scope; did you mean 'ans'?
    9 |        ams+=tmp%10;
      |        ^~~
      |        ans
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define rep2(i, a, n) for(ll i = a; i < (ll)(n); i++)
#define memi cout << endl
#define kono(n) cout << fixed << setprecision(n)
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define hina cout << ' '
#define in(n) cin >> n
#define in2(n, m) cin >> n >> m
#define in3(n, m, l) cin >> n >> m >> l
#define out(n) cout << n
const ll mei = (ll)1e9 + 7;

int main(){
  ll a, b, c, d, e, b, s, t, m;
  m = 0;
  in3(n, s, t);
  rep(i, n + 1){
    a = i / 10000;
    b = (i / 1000) % 10;
    c = (i / 100) % 10;
    d = (i / 10) % 10;
    e = i % 10;
    if(s <= a+b+c+d+e && a+b+c+d+e <= t)
      m = m + i;
  }
  out(m);
  memi;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:21: error: redeclaration of 'll b'
   18 |   ll a, b, c, d, e, b, s, t, m;
      |                     ^
a.cc:18:9: note: 'll b' previously declared here
   18 |   ll a, b, c, d, e, b, s, t, m;
      |         ^
a.cc:20:7: error: 'n' was not declared in this scope
   20 |   in3(n, s, t);
      |       ^
a.cc:13:29: note: in definition of macro 'in3'
   13 | #define in3(n, m, l) cin >> n >> m >> l
      |                             ^
Language: C++

#include <iostream>
using namespace std;

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

int main(){
    int
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:1: error: expected unqualified-id before '}' token
   15 | }
      | ^
Language: C++

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

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

int main() {
  int N, A, B;
  cin >> N >> A >> B;
  int count = 0;
  for (int i = 1; i <= N; i++) {
    int x = f(i);
    if (A <= x && x <= B) count++;
  }
  cout << count << endl;
}


Compiler output:
a.cc: In function 'int f(int)':
a.cc:11:10: error: 'out' was not declared in this scope
   11 |   return out;
      |          ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
  
int main(){
  int N,A,B;
  //Neabcd
  cin >> N >> A >> B;
  
  int sum = 0;
  for(int i=1; i<=N; i++){
    int a,b,c,d,e;
    d=i%10;
    c=((i-d)%100)/10;
    b=((i-d-c*10)%1000)/100;
    a=i/1000%10;
    e=i/10000
    if(A <= a+b+c+d+e && a+b+c+d+e <= B){
      sum += i;
    }
  }
  
  cout << sum << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:14: error: expected ';' before 'if'
   16 |     e=i/10000
      |              ^
      |              ;
   17 |     if(A <= a+b+c+d+e && a+b+c+d+e <= B){
      |     ~~
Language: C++

#include <iostream>
using namespace std;

int sum_digits(int n) {
  int sum = 0;
  while (n > 0) {
    sum += n % 10;
    n /= 10;
  }
  return sum;
}
int main() {
  int N, A, B;
  int ret = 0;
  cin >> N >> A >> B;
  for(i=1; i<=N; ++i) {
    int sum = sum_digits(i);
    if (sum >= A && sum <= B) ret += sum;
  }
  cout << ret << endl;
}


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

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

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

int main(){
  int N, A, B;
  cin >> N >> A >> B;
  int count = 0;
  int sum;
  for(int i = 1; i <= N; i++){
    sum = findsum(i);
    if(i >= A && i <= B) count++;
  cout << count << endl;
}
  


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

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

int main(){
  int N, A, B;
  cin >> N >> A >> B;
  int i, j, k, l, m;
  int count = 0;
  for(int i = 1; i <= N; i++){
     m = N%10;
     l = (N/10)%10;
     k = (N/100)%10;
     j = (N/1000)%10;
     i = (N/10000)%10
     if(i + j + k + l + m >= A && i + j + k + l + m <= B)count++;
  }
  cout << count << endl;
}
  


Compiler output:
a.cc: In function 'int main()':
a.cc:14:22: error: expected ';' before 'if'
   14 |      i = (N/10000)%10
      |                      ^
      |                      ;
   15 |      if(i + j + k + l + m >= A && i + j + k + l + m <= B)count++;
      |      ~~
Language: Java

import java.util.Scanner;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int num = sc.nextInt();
    int a = sc.nextInt();
    int b = sc.nextInt();
    int sum = 0;
    
    for(int i =1; i <= num; i++){
		int j = i;
      	while(j !=0){
        wa+= j%10;
          j = j/10;
        }
      if(wa >= a && wa <= b){
		sum += i;
      }
    }  
    System.out.println(sum);
  }
}

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

import java.util.Scanner;

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 sum = 0;
    for(int i=1;i<=N;i++){
      int n = i;
      int digSum = 0;
      while(n>0){
        digSum += n%10;
        n /= 10;
      }
      if(digSum>=A && digSum<=B){
        sum += i;
      }
    }
    System.out.println(sum);
  }
}

Compiler output:
Main.java:6: error: cannot find symbol
    int N = sc.nextInt;
              ^
  symbol:   variable nextInt
  location: variable sc of type Scanner
Main.java:7: error: cannot find symbol
    int A = sc.nextInt;
              ^
  symbol:   variable nextInt
  location: variable sc of type Scanner
Main.java:8: error: cannot find symbol
    int B = sc.nextInt;
              ^
  symbol:   variable nextInt
  location: variable sc of type Scanner
3 errors
Language: C++

#include <bits/stdc++.h>
using namespace std;
int N,A,B;
int w,s;
N==w*10+s;
if(A<=w+s<=B){
  int f==w+s;
cout<<f<<endl;
}
else{
  cout<<""<<endl;
}



Compiler output:
a.cc:5:1: error: 'N' does not name a type
    5 | N==w*10+s;
      | ^
a.cc:6:1: error: expected unqualified-id before 'if'
    6 | if(A<=w+s<=B){
      | ^~
a.cc:10:1: error: expected unqualified-id before 'else'
   10 | else{
      | ^~~~
Language: C

#include <stdio.h>
 
int main () 
{
int a,b,n;
int count = 0;
scanf("%d %d %d",&n,&a,&b);

for(int i=0;i<N;i++)
{
    int p,q,r,s,t;
    p = i%10;
    q = (i/10)%10;
    r = (i/100)%10;
    s = (i/1000)%10;
    t = (i/10000)%10;

    if(a <= p+q+r+s+t && p+q+r+s+t <= b)
    {
        count++;
    }
}

}

Compiler output:
main.c: In function 'main':
main.c:9:15: error: 'N' undeclared (first use in this function)
    9 | for(int i=0;i<N;i++)
      |               ^
main.c:9:15: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include<iostream>
using namespace std;
int check(int i,int down,int up)
{
  int res=0;
  while(i>0)
  {
    res+=i%10;
    i/=10
  }
  
  
  if(res>=down&&res<=up)
    return 1;
  else
    return 0;
}
int main()
{
  int n,a,b;
  int total=0;
  cin>>n>>a>>b;
  for(int i = 1;i<=n;i++)
  {
    if(check(i,a,b))
    	total+=i;
  }
  cout<<total<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int check(int, int, int)':
a.cc:9:10: error: expected ';' before '}' token
    9 |     i/=10
      |          ^
      |          ;
   10 |   }
      |   ~
Language: C

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

int main() {
  int N, A, B;
  cin >> N >> A >> B;
  int a, b, c, d;
  int ans = 0;
  
  for (int i = 0; i <= N; i++){
    int x = i + 1;
    int tmp = a + b + c + d;
    
    a = x / 1000;
    x = x % 1000;
    
    b = x / 100;
    x = x % 100;
    
    c = x / 10;
    x = x % 10;
    
    d = x;
    
    if (A <= tmp && tmp <= B){
      ans = ans + i;
      continue;
    }
    
  }
  
  cout << ans << endl;
  return 0;
}

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

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

/*
int main() {
	int sum=0,N,A,B,k,a,b,c,d;
	cin>>N>>A>>B;
	for(int i=1;i<=N;i++){
		a=i/1000;
		k=i%1000;
		b=k/100;
		k=k%100;
		c=k/10;
		d=k%10;
		
		if(A<=a+b+c+d&&a+b+c+d<=B){
			sum+=i;
		}
	}
	
	cout<<sum<<endl;
}
*/

int main(){
	
}

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

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

Compiler output:
a.cc: In function 'int FindSum(int)':
a.cc:35:1: warning: no return statement in function returning non-void [-Wreturn-type]
   35 | }
      | ^
a.cc: At global scope:
a.cc:37:5: error: redefinition of 'int main()'
   37 | int main(){
      |     ^~~~
a.cc:25:5: note: 'int main()' previously defined here
   25 | int main(){
      |     ^~~~
Language: C++

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

int main() {
	int sum=0,N,A,B,k,a,b,c,d;
	cin>>N>>A>>B;
	for(int i=1;i<=N;i++){
		i/1000=a;
		i%1000=k;
		k/100=b;
		k%100=k;
		k/10=c;
		k%10=d;
		
		if(A<=a+b+c+d&&a+b+c+d<=B){
			sum+=i;
		}
	}
	
	cout<<sum<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:18: error: lvalue required as left operand of assignment
    8 |                 i/1000=a;
      |                 ~^~~~~
a.cc:9:18: error: lvalue required as left operand of assignment
    9 |                 i%1000=k;
      |                 ~^~~~~
a.cc:10:18: error: lvalue required as left operand of assignment
   10 |                 k/100=b;
      |                 ~^~~~
a.cc:11:18: error: lvalue required as left operand of assignment
   11 |                 k%100=k;
      |                 ~^~~~
a.cc:12:18: error: lvalue required as left operand of assignment
   12 |                 k/10=c;
      |                 ~^~~
a.cc:13:18: error: lvalue required as left operand of assignment
   13 |                 k%10=d;
      |                 ~^~~
Language: C++

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

int main() {
	int sum=0,N,A,B,k,a,b,c,d;
	cin>>N>>A>>B;
	for(int i=1;i<=N;i++){
		i/1000=a
		i%1000=k;
		k/100=b;
		k%100=k;
		k/10=c;
		k%10=d;
		
		if(A<=a+b+c+d&&a+b+c+d<=B){
			sum+=i;
		}
	}
	
	cout<<sum<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:18: error: lvalue required as left operand of assignment
    8 |                 i/1000=a
      |                 ~^~~~~
a.cc:10:18: error: lvalue required as left operand of assignment
   10 |                 k/100=b;
      |                 ~^~~~
a.cc:11:18: error: lvalue required as left operand of assignment
   11 |                 k%100=k;
      |                 ~^~~~
a.cc:12:18: error: lvalue required as left operand of assignment
   12 |                 k/10=c;
      |                 ~^~~
a.cc:13:18: error: lvalue required as left operand of assignment
   13 |                 k%10=d;
      |                 ~^~~
Language: C++

#include <iostream>
#include <algorithm>
#include <string> 
#include <math.h>
#include <vector>
#define rep(i,n) for(int i=0; i< int(n); i++)
using namespace std;

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


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


} 



Compiler output:
a.cc: In function 'int main()':
a.cc:25:17: error: expected ',' or ';' before 'if'
   25 |                 if(sum >= a && sum <= b) total += i;
      |                 ^~
Language: C++

#include <iostream>
#include <algorithm>
#include <string> 
#include <math.h>
#include <vector>
#define rep(i,n) for(int i=0; i< int(n); i++)
using namespace std;

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


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


} 



Compiler output:
a.cc: In function 'int findSumOfDigits()':
a.cc:11:15: error: 'n' was not declared in this scope; did you mean 'yn'?
   11 |         while(n>0){
      |               ^
      |               yn
a.cc: In function 'int main()':
a.cc:24:42: error: too many arguments to function 'int findSumOfDigits()'
   24 |                 int sum = findSumOfDigits(i)
      |                           ~~~~~~~~~~~~~~~^~~
a.cc:9:5: note: declared here
    9 | int findSumOfDigits(){
      |     ^~~~~~~~~~~~~~~
a.cc:25:17: error: expected ',' or ';' before 'if'
   25 |                 if(sum >= a && sum <= b) total += i;
      |                 ^~
Language: C++

# 値を受け取る
N, A, B = map(int, input().split())

ans = 0
for i in range(N+1):
  if A <= sum(list(map(int, str(i)))) <= B:
    ans += i

print(ans)


Compiler output:
a.cc:1:3: error: invalid preprocessing directive #\U00005024\U00003092\U000053d7\U00003051\U000053d6\U0000308b
    1 | # 値を受け取る
      |   ^~~~~~~~~~~~
a.cc:2:1: error: 'N' does not name a type
    2 | N, A, B = map(int, input().split())
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
  
  int SumDigid(int x){
    int count = 0;
    while(true){
      count += x%10;
      if( x / 10 < 1)break;
      x = (x - (x%10))/10;
    }
    return count;
  }
  int main(){
    int N, A, B;
    cin >> N >> A >> B;
    cot = 0;
    for (int i = 1; i <= N;i++){
      if(SumDigid(i)>= A && SumDigid(i) <= B){
        cot++;}
    }
    cout << cot << endl;
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:16:5: error: 'cot' was not declared in this scope; did you mean 'cos'?
   16 |     cot = 0;
      |     ^~~
      |     cos
Language: C++

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

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

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


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

#include<bits/stdc++.h>
using namespace std;
int main(){
  int N;
  int A,B;
  cin >> N >> A >> B;
  int sum=0
  for(int i=1;i<=N;i++){
    int count = 0;
    count+=i/1000;
    i%=1000;
    count+=i/100;
    i%=100;
    count+=i/10;
    i%=10;
    count+=i;
    if(A<=i&&i<=B){
      sum+=i;
    }
  }
  cout<<sum;
}
    
    
  

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


#include "stdafx.h"
#include <iostream>
#include <string>

using namespace std;

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

int main()
{
	int N, A, B;
	cin >> N >> A >> B;
	double sum = 0;

	for (int i = 1; i <= N; i++) {
		int digit_sum = sumDigit(i);
		if (digit_sum >= A && digit_sum <= B) {
			sum += i;
		}
	}
	cout << sum;
	return 0;
}

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

#include<stdio.h>
int main() {
   scanf("%d%d%d", &n, &a, &b);
   int r = 0;
   for(int i=1; i<=n; i++) {
      int c = 0, t = i;
      for(int j=0; j<5; j++) c+=t%10, t/=10;
      if (a<=c && c<=b) r+=i;
   }
   printf("%d\n", r);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:21: error: 'n' was not declared in this scope
    3 |    scanf("%d%d%d", &n, &a, &b);
      |                     ^
a.cc:3:25: error: 'a' was not declared in this scope
    3 |    scanf("%d%d%d", &n, &a, &b);
      |                         ^
a.cc:3:29: error: 'b' was not declared in this scope
    3 |    scanf("%d%d%d", &n, &a, &b);
      |                             ^
Language: C

#include <stdio.h>
int main( )
{
int n,a,b;
scanf(”%d %d %d”,&n, &a, &b);
int r = 0;
for(inti = 1;i <= n; i++)
{
int c = 0, t = i;
for(int j=0;j<5;j++)c+=t % 1 0, t /= 1 0;
if(a <= c&&c <= b) r += i;
}
printf(”%d\n”,r) ;
}


Compiler output:
main.c: In function 'main':
main.c:5:7: error: stray '\342' in program
    5 | scanf(<U+201D>%d %d %d<U+201D>,&n, &a, &b);
      |       ^~~~~~~~
main.c:5:8: error: expected expression before '%' token
    5 | scanf(”%d %d %d”,&n, &a, &b);
      |        ^
main.c:5:16: error: stray '\342' in program
    5 | scanf(<U+201D>%d %d %d<U+201D>,&n, &a, &b);
      |                       ^~~~~~~~
main.c:7:5: error: 'inti' undeclared (first use in this function); did you mean 'int'?
    7 | for(inti = 1;i <= n; i++)
      |     ^~~~
      |     int
main.c:7:5: note: each undeclared identifier is reported only once for each function it appears in
main.c:7:14: error: 'i' undeclared (first use in this function)
    7 | for(inti = 1;i <= n; i++)
      |              ^
main.c:10:29: error: expected ';' before numeric constant
   10 | for(int j=0;j<5;j++)c+=t % 1 0, t /= 1 0;
      |                             ^~
      |                             ;
main.c:13:8: error: stray '\342' in program
   13 | printf(<U+201D>%d\n<U+201D>,r) ;
      |        ^~~~~~~~
main.c:13:9: error: expected expression before '%' token
   13 | printf(”%d\n”,r) ;
      |         ^
main.c:13:11: error: stray '\' in program
   13 | printf(”%d\n”,r) ;
      |           ^
main.c:13:13: error: stray '\342' in program
   13 | printf(<U+201D>%d\n<U+201D>,r) ;
      |                    ^~~~~~~~
Language: C

#i n cl u d e <s t d i o . h>
i n t main ( )
{
i n t n , a , b ;
s c a n f (”%d%d%d ” , &n , &a , &b ) ;
i n t r = 0 ;
f o r ( i n t i = 1 ; i <= n ; i++)
{
i n t c = 0 , t = i ;
f o r ( i n t j = 0 ; j < 5 ; j++)c += t % 1 0 , t /= 1 0;
i f ( a <= c&&c <= b ) r += i ;
}
p r i n t f (”%d\n ” , r ) ;
}


Compiler output:
main.c:1:2: error: invalid preprocessing directive #i; did you mean #if?
    1 | #i n cl u d e <s t d i o . h>
      |  ^
      |  if
main.c:2:1: error: unknown type name 'i'
    2 | i n t main ( )
      | ^
main.c:2:5: error: expected '=', ',', ';', 'asm' or '__attribute__' before 't'
    2 | i n t main ( )
      |     ^
main.c:2:5: error: unknown type name 't'
main.c:5:12: error: stray '\342' in program
    5 | s c a n f (<U+201D>%d%d%d <U+201D> , &n , &a , &b ) ;
      |            ^~~~~~~~
main.c:5:20: error: stray '\342' in program
    5 | s c a n f (<U+201D>%d%d%d <U+201D> , &n , &a , &b ) ;
      |                           ^~~~~~~~
main.c:13:14: error: stray '\342' in program
   13 | p r i n t f (<U+201D>%d\n <U+201D> , r ) ;
      |              ^~~~~~~~
main.c:13:17: error: stray '\' in program
   13 | p r i n t f (”%d\n ” , r ) ;
      |                 ^
main.c:13:20: error: stray '\342' in program
   13 | p r i n t f (<U+201D>%d\n <U+201D> , r ) ;
      |                           ^~~~~~~~
Language: C++

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

int main (){

  int n, a, b;
  cin >> n >> a >> b;
  int sum=0;
  int ketawa;
  for(int i=1; i<=n; i++){
    ketawa = (i%10) + ((i/10)%10) + ((i/100)%10) + ((i/1000)%10 + ((i/10000)%10);
  	if((ketawa >= a) && (ketawa <= b)){
    	sum += i;
    }
  }
  cout << sum << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:81: error: expected ')' before ';' token
   11 |     ketawa = (i%10) + ((i/10)%10) + ((i/100)%10) + ((i/1000)%10 + ((i/10000)%10);
      |                                                    ~                            ^
      |                                                                                 )
Language: C++

#include<iostream>

using namespace std;

int main()
{
  int n,a,b;
  cin >> n >> a >> b;
  
  int total = 0;
  for(int i = 0;i<=n;i++){
    int number = i;
    int keta_total = 0;
    while(number!=0){
      keta_total += number%10;
      number = number/10
    }
    if(a <= keta_total && keta_total <= b)total += keta_total;
  }
  cout << total << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:25: error: expected ';' before '}' token
   16 |       number = number/10
      |                         ^
      |                         ;
   17 |     }
      |     ~
Language: C++

#include<iostream>

using namespace std;

int main()
{
  int n,a,b;
  cin >> n >> a >> b;
  
  int total = 0
  for(int i = 0;i<=n;i++){
    int number = i;
    int keta_total = 0;
    while(number!=0){
      keta_total += number%10;
      number = number/10
    }
    if(a <= keta_total && keta_total <= b)total += keta_total;
  }
  cout << total << endl;
}

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

(defmacro while (condition &body body)
  `(do ()
       ((not ,condition))
     ,@body))

(defun counting (n)
  (let ((sum 0))
    (while (> n 0)
      (setf sum (+ sum (rem n 10)))
      (setf n (floor n 10)))
    sum))

(defun some-sums ()
    (let ((n (1+ (read)))
	  (a (read))
	  (b (read))
	  (ans 0))
      (dotimes (i n)
	(if (and
	     (>= (counting i) a)
	     (<= (counting i) b))
	    (incf ans)))
      ans))
      
(format t "~A~%" (some-sums))

Compiler output:
a.cc:2:3: error: stray '`' in program
    2 |   `(do ()
      |   ^
a.cc:4:7: error: stray '@' in program
    4 |      ,@body))
      |       ^
a.cc:1:10: error: expected ')' before 'while'
    1 | (defmacro while (condition &body body)
      | ~        ^~~~~~
      |          )
Language: C++

#include<iosteam>
using namespace std;
int sum(int x){
 	int ret = 0;
  	while(x){
     	ret += x % 10;
       	x /= 10;
    }
  	return ret;
}
int main(){
 	int n, a, b; cin >> n >> a >> b;
  	int ans = 0;
  	for(int i = 1; i <= n; ++i){
		int x = sum(i);
      	if(x <= b && x >= a) ans += i; 
    }
  	cout << ans << endl;
  	return 0;
}

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

(defun sum (x)  
  (let ((ret 0))
    (loop
       (if (zerop x) (return))
       (setf ret (+ ret (rem x 10)))
       (setf x (floor x 10)))
    ret))

(defun fun (n a b)
  (let ((ans 0)
	(x 0))
    (dotimes (i (1+ n))
      (setf x (sum i))
      (if (and
	   (<= a x)
	   (>= b x))
	  (setf ans (+ ans i))))
    ans))

(format t "~A~%" (fun (read) (read) (read)))


Compiler output:
a.cc:1:7: error: expected ')' before 'sum'
    1 | (defun sum (x)
      | ~     ^~~~
      |       )
Language: C++

(defun sum (x)  
  (let ((ret 0))
    (loop
       (if (zerop x) (return))
       (setf ret (+ ret (rem x 10)))
       (setf x (floor x 10)))
    ret))

(defun fun (n a b)
  (let ((ans 0)
	(x 0))
    (dotimes (i (1+ n))
      (setf x (sum i))
      (if (and
	   (<= a x)
	   (>= b x))
	  (cond
	    (setf ans (+ ans i)))))
    ans))

(format t "~A~%" (fun (read) (read) (read)))


Compiler output:
a.cc:1:7: error: expected ')' before 'sum'
    1 | (defun sum (x)
      | ~     ^~~~
      |       )
Language: C++

(defun sum (x)
  (let ((ret 0))
    (loop
       (if (zerop x) (return))
       (setf ret (+ ret (rem x 10)))
       (setf x (floor x 10)))
    ret))

(defun fun (n a b)
  (let ((ans 0)
	(x 0))
    (dotimes (i (1+ n))
      (setf x (sum i))
      (if (and
	   (<= a x)
	   (>= b x))
	  (incf ans)))
    ans))

(format t "~A~%" (fun (read) (read) (read)))


Compiler output:
a.cc:1:7: error: expected ')' before 'sum'
    1 | (defun sum (x)
      | ~     ^~~~
      |       )
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int A,B,N;
    cin >> N>>A>>B;
    int sum=0;
    for (int i = 0; i < N+1; i++)
    {
        a=i/10;
        b=i-a;
        if (a+b>=A)
        {
            if (a+b<=B)
            {
                sum+=i
            }
            
        }
        
    }
    cout<<sum<<endl;
    
    
    
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: 'a' was not declared in this scope
   10 |         a=i/10;
      |         ^
a.cc:11:9: error: 'b' was not declared in this scope
   11 |         b=i-a;
      |         ^
a.cc:16:23: error: expected ';' before '}' token
   16 |                 sum+=i
      |                       ^
      |                       ;
   17 |             }
      |             ~
Language: C

#include <stdio.h>

int main(void)
{
    int n;
    int a;
    int b;
    int i,j;
    int tmp;
    int sum;
    int rslt;

    //initialize
    rslt = 0;

    scanf("%d %d %d", &n, &a, &b);
    
    for(i=1; i<=n; i++){
        sum = 0; 
        tmp = i;
        for(j=0; j<5; j++){1
            sum += tmp%10;
            tmp /=10;
        }
        if( (a<=sum) && (sum<=b) ){
                rslt += i;
        }
    }
    printf("%d\n", rslt);
}

Compiler output:
main.c: In function 'main':
main.c:21:29: error: expected ';' before 'sum'
   21 |         for(j=0; j<5; j++){1
      |                             ^
      |                             ;
   22 |             sum += tmp%10;
      |             ~~~
Language: C++

#include <iostream>

using std::cin;
using std::cout;
using std::endl;

static int
solve(int N, int A, int B)
{
  int ret = 0;
  for (int x = 1; x <= N; x++)
  {
    int y = (x / 10000
             + x / 1000 % 10
             + x / 100 % 10
             + x / 10 % 10
             + x % 10);
    if (A <= y && y <= B)
    {
      ret++;
    }
  }
  return ret;
}

int
main()
{
  int N, A, B;
  cin >> N >> S >> B;
  cout << solve(N, A, B) << endl;
  return 0;
}


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

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

int sumdigit(int d);

int main() {
  int a,b,c;
  cin >> a;
  cin >> b;
  cin >> c;
  int t = 0;
  int sum = 0;
  for(i=1;i<=a;i++){
    t = sumdigit(i);
    if(a <= t && a >= t){
      sum = sum +  
    }
  }
  int sum = sumdigit(456);
  std::cout << sum << std::endl;
}

int sumdigit(int d){
  int sum = 0;
  int n = 0;
  int dd = d;
  while(int(d/10) > 0){
    n++;
    d=int(d/10);
  }  
  for(int i=0; i<=n; i++){
    int tmp = pow(10,n-i);
    int s = int(dd/tmp);
    // cout << s << "\n";
    sum = sum + s;
    dd=dd - s*tmp;
  }
  return sum;
}

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<=a;i++){
      |       ^
a.cc:19:5: error: expected primary-expression before '}' token
   19 |     }
      |     ^
a.cc:21:7: error: redeclaration of 'int sum'
   21 |   int sum = sumdigit(456);
      |       ^~~
a.cc:14:7: note: 'int sum' previously declared here
   14 |   int sum = 0;
      |       ^~~
Language: C++

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

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  int n, a, b;
  cin >> n >> a >> b;
  int count = 0;
  auto f = [&](int c) {
    int digit = 0;
    while(c > 0) {
      digit += c % 10;
      c = c / 10;
    }
    return digit;
  };
  for(int i = 0; i < n; i++) {
    if(f(i) >= a && f(i) <= b) {
      count += i;
    }
  }
  cout << count << endl;
}
      

      

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

#include <iostream>
using namespacace std;

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

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


Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namespacace'
    2 | using namespacace std;
      |       ^~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:15:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   15 |   cin >> N >> A >> B;
      |   ^~~
      |   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: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/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <iostream>
using namespacace std;

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

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


Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namespacace'
    2 | using namespacace std;
      |       ^~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:15:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   15 |   cin >> N >> A >> B;
      |   ^~~
      |   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:18:21: error: 'n' was not declared in this scope
   18 |     int sum=findsum(n);
      |                     ^
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/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <iostream>
using namspacace std;

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

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


Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namspacace'
    2 | using namspacace std;
      |       ^~~~~~~~~~
a.cc: In function 'int main()':
a.cc:15:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   15 |   cin >> N >> A >> B;
      |   ^~~
      |   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:18:21: error: 'n' was not declared in this scope
   18 |     int sum=findsum(n);
      |                     ^
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/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <iostream>
using namspacace std;

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

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


Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namspacace'
    2 | using namspacace std;
      |       ^~~~~~~~~~
a.cc: In function 'int main()':
a.cc:15:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   15 |   cin >> N >> A >> B;
      |   ^~~
      |   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:18:18: error: 'n' was not declared in this scope
   18 |     int sum=fing(n);
      |                  ^
a.cc:18:13: error: 'fing' was not declared in this scope
   18 |     int sum=fing(n);
      |             ^~~~
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/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <iostream>
using namspaca std;

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

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


Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namspaca'
    2 | using namspaca std;
      |       ^~~~~~~~
a.cc: In function 'int main()':
a.cc:15:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   15 |   cin >> N >> A >> B;
      |   ^~~
      |   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:18:18: error: 'n' was not declared in this scope
   18 |     int sum=fing(n);
      |                  ^
a.cc:18:13: error: 'fing' was not declared in this scope
   18 |     int sum=fing(n);
      |             ^~~~
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/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:24:1: error: expected primary-expression before '}' token
   24 | }
      | ^
Language: C++

#include <iostream>
using namespace std;

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:16:13: error: expected initializer before numeric constant
   16 |   int total 0;
      |             ^
a.cc:20:7: error: 'total' was not declared in this scope
   20 |       total += i;
      |       ^~~~~
a.cc:23:11: error: 'total' was not declared in this scope
   23 |   cout << total << endl;
      |           ^~~~~
Language: C++

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

int main(){
  ll n,a,b;
  cin >> n >> a >> b;
  ll c = 0,nn;
  for(int i = 1; i <= n; ++i){
    nn = (i / 10) + (i % 10);
    if(nn >= a && nn <= b){
      c += i;
    }
  }

  cout << c << endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'll' was not declared in this scope
    5 |   ll n,a,b;
      |   ^~
a.cc:6:10: error: 'n' was not declared in this scope; did you mean 'yn'?
    6 |   cin >> n >> a >> b;
      |          ^
      |          yn
a.cc:6:15: error: 'a' was not declared in this scope
    6 |   cin >> n >> a >> b;
      |               ^
a.cc:6:20: error: 'b' was not declared in this scope
    6 |   cin >> n >> a >> b;
      |                    ^
a.cc:7:5: error: expected ';' before 'c'
    7 |   ll c = 0,nn;
      |     ^~
      |     ;
a.cc:9:5: error: 'nn' was not declared in this scope; did you mean 'yn'?
    9 |     nn = (i / 10) + (i % 10);
      |     ^~
      |     yn
a.cc:11:7: error: 'c' was not declared in this scope
   11 |       c += i;
      |       ^
a.cc:15:11: error: 'c' was not declared in this scope
   15 |   cout << c << endl;
      |           ^