Language: C++

#include <iostream>
int main(){
	int N,A,B;
	int s,d;
    div_t c;
	cin >> N >> A >> B;
	for(int i=0;i<=N;i++){
		d=i;
		c=div(i,100000);
		if(div(d,10000)){
			c=div(d,10000);
			d=d-10000;
		}
		if(div(d,1000)){
			c=c+div(d,1000);
			d=d-div(d,1000)*1000;
		}
		if(div(d,100)){
			c=c+div(d,100);
			d=d-div(d,100)*100;
		}
		if(div(d,10)){
			c=c+div(d,10);
			d=d+div(d,10)*10;
		}
		if(div(d,1)){
			c=c+div(d,1);
			d=d+div(d,1);
		}
		if((c>=A)&&(c<=B)){
			s=s+i;
		}
	}
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |         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:10:23: error: could not convert 'div(d, 10000)' from 'div_t' to 'bool'
   10 |                 if(div(d,10000)){
      |                    ~~~^~~~~~~~~
      |                       |
      |                       div_t
a.cc:14:23: error: could not convert 'div(d, 1000)' from 'div_t' to 'bool'
   14 |                 if(div(d,1000)){
      |                    ~~~^~~~~~~~
      |                       |
      |                       div_t
a.cc:15:28: error: no match for 'operator+' (operand types are 'div_t' and 'div_t')
   15 |                         c=c+div(d,1000);
      |                           ~^~~~~~~~~~~~
      |                           |    |
      |                           |    div_t
      |                           div_t
a.cc:16:40: error: no match for 'operator*' (operand types are 'div_t' and 'int')
   16 |                         d=d-div(d,1000)*1000;
      |                             ~~~~~~~~~~~^~~~~
      |                                |        |
      |                                div_t    int
a.cc:18:23: error: could not convert 'div(d, 100)' from 'div_t' to 'bool'
   18 |                 if(div(d,100)){
      |                    ~~~^~~~~~~
      |                       |
      |                       div_t
a.cc:19:28: error: no match for 'operator+' (operand types are 'div_t' and 'div_t')
   19 |                         c=c+div(d,100);
      |                           ~^~~~~~~~~~~
      |                           |    |
      |                           |    div_t
      |                           div_t
a.cc:20:39: error: no match for 'operator*' (operand types are 'div_t' and 'int')
   20 |                         d=d-div(d,100)*100;
      |                             ~~~~~~~~~~^~~~
      |                                |       |
      |                                div_t   int
a.cc:22:23: error: could not convert 'div(d, 10)' from 'div_t' to 'bool'
   22 |                 if(div(d,10)){
      |                    ~~~^~~~~~
      |                       |
      |                       div_t
a.cc:23:28: error: no match for 'operator+' (operand types are 'div_t' and 'div_t')
   23 |                         c=c+div(d,10);
      |                           ~^~~~~~~~~~
      |                           |    |
      |                           |    div_t
      |                           div_t
a.cc:24:38: error: no match for 'operator*' (operand types are 'div_t' and 'int')
   24 |                         d=d+div(d,10)*10;
      |                             ~~~~~~~~~^~~
      |                                |      |
      |                                div_t  int
a.cc:26:23: error: could not convert 'div(d, 1)' from 'div_t' to 'bool'
   26 |                 if(div(d,1)){
      |                    ~~~^~~~~
      |                       |
      |                       div_t
a.cc:27:28: error: no match for 'operator+' (operand types are 'div_t' and 'div_t')
   27 |                         c=c+div(d,1);
      |                           ~^~~~~~~~~
      |                           |    |
      |                           |    div_t
      |                           div_t
a.cc:28:28: error: no match for 'operator+' (operand types are 'int' and 'div_t')
   28 |                         d=d+div(d,1);
      |                           ~^~~~~~~~~
      |                           |    |
      |                           int  div_t
a.cc:30:22: error: no match for 'operator>=' (operand types are 'div_t' and 'int')
   30 |                 if((c>=A)&&(c<=B)){
      |                     ~^~~
      |                     |  |
      |                     |  int
      |                     div_t
a.cc:30:30: error: no match for 'operator<=' (operand types are 'div_t' and 'int')
   30 |                 if((c>=A)&&(c<=B)){
      |                             ~^~~
      |                             |  |
      |                             |  int
      |                             div_t