#Serial Number !Solved ?Unsolved
#01 !(Code provided by lxmxn)
Find narcissistic numbers?
Similar type of problem: Find Pythagorean triples? (Code provided by namejm)
#02 !(Code provided by zouzhxi)
There are four numbers. When any three numbers are added together, the resulting sums are 84, 88, 99, and 110 respectively. Find these four numbers?
#03 !
Miss Zhao's age has the following characteristics:
1. Its cube is a four-digit number, and its fourth power is a six-digit number;
2. These four-digit number and six-digit number are exactly composed of the ten digits from 0 to 9.
Ask, what number should this be?
【Problem-solving idea】
Take an unknown number, first obtain the cube and fourth power of this number respectively; then divide the ten digits respectively and define them, and finally check whether all from 0 to 9 have been defined. If all have been defined, then this number meets the requirements; otherwise, there are repeated digits and it does not meet the requirements.
#04 !
A total of 4889 digits were used to number the pages of a dictionary. How many pages does this dictionary have? Answer: 1499
【Problem-solving idea】
The following method is relatively direct. Directly check the size of the number. If it is less than 10, it is a 1-digit number, 10~99 is 2 digits,.... Then add up all the digits.
#05 !
Ah Cong said that he saw a group of camels in the northwest this time. There are 23 humps and 60 feet. How many single-humped and double-humped camels are there respectively?
【Problem-solving idea】
First determine the total number of camels from the number of feet of camels (divided by 4), and then successively check between 1 and 15 for data that meets the requirements;
#06 !
There is a five-digit odd number. Replace all 2s with 5s and all 5s with 2s in this five-digit odd number, and other numbers remain unchanged, to get a new five-digit number. If half of the new five-digit number is still 1 larger than the original five-digit number, what is the original five-digit number?
【Problem-solving idea】
The clear idea is: the first digit must be 2, and the last digit must be 5 (because it was originally odd, but later can have "half", indicating it is even, so it can be determined that the last digit is 5, which was later replaced with 2.
#07 !
The sum of five consecutive natural numbers can be divisible by 2, 3, 4, 5, and 6 respectively. Find the smallest set of numbers that meets this condition.
【Problem-solving idea】
There is no particular skill. Use the arithmetic sequence formula, first calculate the sum of 5 numbers, and then check whether it can be divisible by 4, 5, 6.
#08 !
I am a three-digit number. There is one digit that is "3", another digit is "1", and the other digit is unknown. If "3" is changed to "4" and "1" is changed to "3", then the original me will be 9 less than half of the assumed me. Do you know what the original number is?
【Problem-solving idea】
Using the method of proof by contradiction, it can be known that the first digit must be 1, so the arrangement of the number may be: 1*3 or 13*, and then check.
#09 !
Farmer Jones said to his wife: "Hey, Maria, if we sell 75 chicks according to my method, then our chicken feed can last for 20 days. However, if we follow your suggestion and buy 100 more chicks, then the chicken feed will only last for 15 days."
"Ah, dear," she replied, "then how many chicks do we have now?"
The problem is here. How many chicks do they have exactly?
【Problem-solving idea】
Throughout the process, the amount of feed the chicks eat is unchanged. Suppose there are X chicks, then there should be: (x-75)*20=(x+100)*15, and then write a loop to see which number is appropriate?!
#10 !
Among all five-digit numbers, how many have exactly two 3s?
【Problem-solving idea】
The following idea is relatively novel. Its principle is: replace all 3s in the number with empty, and the detection method is illustrated by an example:
For example: 75332 becomes 752 after replacement, which is a number with less than 4 digits. Just check its size to meet the requirements of the question.
#11 !
Divide 17 into the sum of several natural numbers, and find the maximum product of these natural numbers?
【Problem-solving idea】
Using high school mathematics knowledge, it can be proved that any number greater than or equal to 4 can be split into two numbers: their sum is equal to the number, and the product is greater than or equal to the number. According to this inference, all numbers will eventually be split into such forms: A*A*A*A....A is 2 or 3 (because only 2 and 3 cannot be split, and the remaining must be only 2 and 3).
For example: 8 can be split like this (without 3):
num1=2*2*2*2 or can be split into (with 2 threes): num2=2*3*3, then just compare the sizes of the two nums!
#12 !
Multiply natural numbers 2, 3...... together. The last 6 digits of their product are exactly all 0s. What is the minimum possible value of the last natural number?
#13 !
The sum of the dividend, divisor, and quotient is 181, and the quotient is 12. Find the dividend.
#14 !
There are six boxes of goods in the store, weighing 15, 16, 18, 19, 20, and 31 kilograms respectively. Two customers bought five of them. It is known that the weight of the goods bought by one customer is twice that of the other customer. Then, what is the weight of the remaining box of goods in the store?
【Problem-solving idea】
A known condition that can be quickly inferred is: the total mass of the two bags of goods bought by the two customers can be divisible by 3, and the other customer's can be divisible by 2.......
#15 !
A number has a remainder of 2 when divided by 3 and a remainder of 1 when divided by 5. What is the remainder when this number is divided by 15?
#16 !
1. p is a prime number, and p×p+1 is also a prime number. Find 2006×p.
2. What is the remainder when the product of 2006 2s is divided by 7?
【Problem-solving idea】
1> PxP+1 is a prime number, so PxP+1 is odd (except 2), then P×P is even, so P must be even, then P=2
2> 2^2006 can be written in the form: 2^2006=8^668×2×2=(7+1)^668×4. According to the binomial theorem, the remainder of 2^2006 divided by 7 is: 4
#17 !
It is said that in a holy temple in India, there is a brass plate with three gem needles inserted on it. On the first gem needle, from bottom to top, there are 64 golden plates with holes in the center, arranged from largest to smallest. The monks in the temple move the plates according to the following rules: only one plate can be moved at a time, and the small plate must always be placed on the large plate. At that time, it was said that when all 64 golden plates were moved to another gem needle, the world would be destroyed in a thunderclap. How many times does it take to move 64 golden plates to another gem needle? This is a very large number!
Answer: 18446744073709551615
【Problem-solving idea】According to relevant knowledge such as geometric sequences, it is known that the total number of times required is: 2^64-1. This number is extremely large, and direct calculation is definitely not feasible. Then we have to adopt the method of "segmented calculation in a clock-like manner". If it is not original, please forgive my rudeness!
The following code divides the data into 6 segments, each with 6 digits to save respectively. Its basic principle is: when the last segment of data is multiplied by 2, if its value is greater than 1000000, carry over, add the carried data to the previous segment of data, and so on. This segment of code currently supports the continuous multiplication of 200 2s. Of course, you can "modify" it to calculate more massive numbers.
#18 !
There are ten RMB notes with denominations of 1 cent, 2 cents, 5 cents, 1 jiao, 2 jiao, 5 jiao, 1 yuan, 2 yuan, 5 yuan, and 10 yuan. How many different denominations can be formed?
【Problem-solving idea】According to the relevant knowledge of permutations and combinations, it is known that the total number of combinations may be: num=C(10,1)+C(10,2)+..+C(10,10)
#01 !(Code provided by lxmxn)
Find narcissistic numbers?
@echo off&&setlocal ENABLEDELAYEDEXPANSION
for %%a in (1 2 3 4 5 6 7 8 9) do (
for %%b in (0 1 2 3 4 5 6 7 8 9) do (
for %%c in (0 1 2 3 4 5 6 7 8 9) do (
set/a result=%%a*%%a*%%a+%%b*%%b*%%b+%%c*%%c*%%c
if "!result!"=="%%a%%b%%c" (
echo %%a%%b%%c is a narcissistic number!
)
)
)
)
pause
Similar type of problem: Find Pythagorean triples? (Code provided by namejm)
@echo off
echo.
echo Pythagorean triples within 100 are as follows:
echo.
setlocal enabledelayedexpansion
for /l %%i in (1,1,100) do (
for /l %%j in (1,1,100) do (
for /l %%k in (1,1,100) do (
set /a a=%%i*%%i
set /a b=%%j*%%j
set /a c=%%k*%%k
set /a sum=!a!+!b!
if !sum! equ !c! echo %%i %%j %%k
)
)
)
pause
#02 !(Code provided by zouzhxi)
There are four numbers. When any three numbers are added together, the resulting sums are 84, 88, 99, and 110 respectively. Find these four numbers?
@ECHO OFF
echo.
setlocal enabledelayedexpansion
SET A=84
SET B=88
SET C=99
SET D=110
SET /A ABCD=A+B+C+D
SET /A SUM=ABCD/3
SET /A NO1=SUM-A
SET /A NO2=SUM-B
SET /A NO3=SUM-C
SET /A NO4=SUM-D
ECHO.
ECHO.NO1^=%NO1%
ECHO.NO2^=%NO2%
ECHO.NO3^=%NO3%
ECHO.NO4^=%NO4%
PAUSE
#03 !
Miss Zhao's age has the following characteristics:
1. Its cube is a four-digit number, and its fourth power is a six-digit number;
2. These four-digit number and six-digit number are exactly composed of the ten digits from 0 to 9.
Ask, what number should this be?
【Problem-solving idea】
Take an unknown number, first obtain the cube and fourth power of this number respectively; then divide the ten digits respectively and define them, and finally check whether all from 0 to 9 have been defined. If all have been defined, then this number meets the requirements; otherwise, there are repeated digits and it does not meet the requirements.
@echo off
setlocal enabledelayedexpansion
for /l %%i in (10 1 30) do (
::Clear variables
set flag=
for /l %%a in (0 1 9) do set %%a=
::Obtain cube and fourth power
set /a cube=%%i*%%i*%%i
set /a s=!cube!*%%i
if !cube! geq 1000 if !cube! lss 10000 (
if !s! geq 100000 if !s! lss 1000000 (
set num=!s!!cube!
call :test !num!
if not defined flag echo %%i !num!
)
)
)
pause>nul
:test
for /l %%a in (0 1 9) do (
set var=%1
::Assign the first digit of the parameter to var_; check whether the variable value !var_! has been defined as a variable.
set var_=!var:~%%a,1!
if defined !var_! set flag=1 & goto :eof
set !var_!=A
)
#04 !
A total of 4889 digits were used to number the pages of a dictionary. How many pages does this dictionary have? Answer: 1499
【Problem-solving idea】
The following method is relatively direct. Directly check the size of the number. If it is less than 10, it is a 1-digit number, 10~99 is 2 digits,.... Then add up all the digits.
@echo off
set /a t_num=0
setlocal enabledelayedexpansion
echo Checking data.....
for /l %%i in (1 1 4889) do (
if !t_num! lss 4889 (
if %%i lss 10 set /a t_num+=1
if %%i geq 10 if %%i lss 100 set /a t_num+=2
if %%i geq 100 if %%i lss 1000 set /a t_num+=3
if %%i geq 1000 set /a t_num+=4
) else set /a num=%%i-1 & goto :exit
)
:exit
echo The required number is: %num%
pause>nul
#05 !
Ah Cong said that he saw a group of camels in the northwest this time. There are 23 humps and 60 feet. How many single-humped and double-humped camels are there respectively?
【Problem-solving idea】
First determine the total number of camels from the number of feet of camels (divided by 4), and then successively check between 1 and 15 for data that meets the requirements;
@echo off
set /a F_num=23
set /a J_num=60/4
setlocal enabledelayedexpansion
for /l %%i in (1 1 %J_num%) do (
set /a S_num=%%i
set /a B_num=%J_num%-%%i
set /a num=!S_num!+2*!B_num!
call :test !num! !S_num! !B_num!
)
pause>nul
:test
if %1 EQU %F_num% echo Possible combination: Number of single-humped camels=%2 Number of double-humped camels=%3
goto :eof
#06 !
There is a five-digit odd number. Replace all 2s with 5s and all 5s with 2s in this five-digit odd number, and other numbers remain unchanged, to get a new five-digit number. If half of the new five-digit number is still 1 larger than the original five-digit number, what is the original five-digit number?
【Problem-solving idea】
The clear idea is: the first digit must be 2, and the last digit must be 5 (because it was originally odd, but later can have "half", indicating it is even, so it can be determined that the last digit is 5, which was later replaced with 2.
@echo off & echo Checking data...
setlocal enabledelayedexpansion
for /l %%a in (0 1 9) do (
for /l %%b in (0 1 9) do (
for /l %%c in (0 1 9) do (
set/a Fnum=2%%a%%b%%c5
set Bnum=!Fnum:5=A!
set Bnum=!Bnum:2=5!
set/a Bnum=!Bnum:A=2!
set/a Fnum_=2*!Fnum!+2
if !Bnum! EQU !Fnum_! echo !Fnum!
)))
echo Checking completed!
pause>nul
#07 !
The sum of five consecutive natural numbers can be divisible by 2, 3, 4, 5, and 6 respectively. Find the smallest set of numbers that meets this condition.
【Problem-solving idea】
There is no particular skill. Use the arithmetic sequence formula, first calculate the sum of 5 numbers, and then check whether it can be divisible by 4, 5, 6.
@echo off
echo Checking data....
setlocal enabledelayedexpansion
for /l %%i in (1 1 10000) do (
set /a flag=0
set /a num=5*%%i+10
set /a num1=!num!%%4
set /a num2=!num!%%5
set /a num3=!num!%%6
for %%a in (!num1! !num2! !num3!) do (
if %%a NEQ 0 set /a flag=1
)
if !flag! EQU 0 set /a num=%%i & goto :exit
)
:exit
for /l %%i in (0 1 4) do (
set /a num%%i=%num%+%%i
)
echo The required five consecutive natural numbers are: %num0% %num1% %num2% %num3% %num4%
pause>nul
#08 !
I am a three-digit number. There is one digit that is "3", another digit is "1", and the other digit is unknown. If "3" is changed to "4" and "1" is changed to "3", then the original me will be 9 less than half of the assumed me. Do you know what the original number is?
【Problem-solving idea】
Using the method of proof by contradiction, it can be known that the first digit must be 1, so the arrangement of the number may be: 1*3 or 13*, and then check.
@echo off
rem After deduction, the first digit must be 1, (unless the unknown is 1, and the situation of 1 is also processed in the first for)
setlocal enabledelayedexpansion
for /l %%i in (0 1 9) do (
set /a Fnum=1%%i3
set /a Bnum=3%%i4
set /a num=!Bnum!/2-9
if !Fnum! EQU !num! echo !Fnum!)
for /l %%i in (0 1 9) do (
set /a Fnum=13%%i
set /a Bnum=34%%i
set /a num=!Bnum!/2-9
if !Fnum! EQU !num! echo !Fnum!)
pause>nul
#09 !
Farmer Jones said to his wife: "Hey, Maria, if we sell 75 chicks according to my method, then our chicken feed can last for 20 days. However, if we follow your suggestion and buy 100 more chicks, then the chicken feed will only last for 15 days."
"Ah, dear," she replied, "then how many chicks do we have now?"
The problem is here. How many chicks do they have exactly?
【Problem-solving idea】
Throughout the process, the amount of feed the chicks eat is unchanged. Suppose there are X chicks, then there should be: (x-75)*20=(x+100)*15, and then write a loop to see which number is appropriate?!
@echo off
rem The number of chicks is at least 76:
setlocal enabledelayedexpansion
for /l %%i in (76 1 10000) do (
set /a Fnum=%%i*20-75*20
set /a Bnum=%%i*15+100*15
if !Fnum! EQU !Bnum! echo The number of chicks is: %%i & goto :exit)
:exit
pause>nul
#10 !
Among all five-digit numbers, how many have exactly two 3s?
【Problem-solving idea】
The following idea is relatively novel. Its principle is: replace all 3s in the number with empty, and the detection method is illustrated by an example:
For example: 75332 becomes 752 after replacement, which is a number with less than 4 digits. Just check its size to meet the requirements of the question.
@echo off
echo Checking data........
setlocal enabledelayedexpansion
set /a flag=0
for /l %%i in (10000,1,99999) do (
set num=%%i
rem Adding a 1 in front is to prevent special cases like 30820.
set /a num=1!num:3=!
if !num! lss 2000 if !num! gtr 200 set /a flag+=1)
echo %flag%
echo Checking completed!
pause>nul
#11 !
Divide 17 into the sum of several natural numbers, and find the maximum product of these natural numbers?
【Problem-solving idea】
Using high school mathematics knowledge, it can be proved that any number greater than or equal to 4 can be split into two numbers: their sum is equal to the number, and the product is greater than or equal to the number. According to this inference, all numbers will eventually be split into such forms: A*A*A*A....A is 2 or 3 (because only 2 and 3 cannot be split, and the remaining must be only 2 and 3).
For example: 8 can be split like this (without 3):
num1=2*2*2*2 or can be split into (with 2 threes): num2=2*3*3, then just compare the sizes of the two nums!
@echo off
setlocal enabledelayedexpansion
set num=17
set /a Cnum=%num%/3
set /a Rnum=%num%%%2
set /a Tnum=0
for /l %%i in (%Rnum% 2 %Cnum%) do (
set num_=1
set /a num_tem=%num%/2-%%i*3/2
for /l %%a in (1 1 %%i) do (
set /a num_*=3)
for /l %%b in (1 1 !num_tem!) do (
set /a num_*=2)
if !num_! gtr !Tnum! set /a Tnum=!num_!
)
echo !Tnum!
pause>nul
#12 !
Multiply natural numbers 2, 3...... together. The last 6 digits of their product are exactly all 0s. What is the minimum possible value of the last natural number?
@echo off
echo Checking data........
setlocal enabledelayedexpansion
set /a num=1
set /a flag=0
for /l %%i in (2 1 10000) do (
call :test %%i
if !flag! equ 5 set /a num=%%i & goto :exit)
:exit
echo.
echo The minimum natural number is:!num!
echo.
echo Checking completed!
pause>nul
:test
set /a num=!num!*%1
for /l %%i in (1 1 5) do (
if !num:~-1! EQU 0 (set /a flag+=1 & set /a num=!num:~0,-1!) else (
set /a num=!num:~-1! & goto :eof))
#13 !
The sum of the dividend, divisor, and quotient is 181, and the quotient is 12. Find the dividend.
@echo off
echo Checking data........
setlocal enabledelayedexpansion
for /l %%a in (90 1 180) do (
for /l %%b in (1 1 %%a) do (
set /a num=%%a %% %%b
if !num! EQU 0 (
set /a num=%%a/%%b
set /a num_=!num!+%%a+%%b
if !num_! EQU 181 echo Such numbers exist. Dividend: %%a Divisor: %%b Quotient:!num!
)
)
)
echo.
echo Checking completed!
pause>nul
#14 !
There are six boxes of goods in the store, weighing 15, 16, 18, 19, 20, and 31 kilograms respectively. Two customers bought five of them. It is known that the weight of the goods bought by one customer is twice that of the other customer. Then, what is the weight of the remaining box of goods in the store?
【Problem-solving idea】
A known condition that can be quickly inferred is: the total mass of the two bags of goods bought by the two customers can be divisible by 3, and the other customer's can be divisible by 2.......
@echo off
set /a num=15+16+18+19+20+31
set Tnum=15 16 18 19 20 31
setlocal enabledelayedexpansion
rem ==========================
rem Question 14:
for %%i in (15 16 18 19 20 31) do call :test %%i
echo The mass of the remaining bag is:!result1!
echo The masses of the two bags with less mass are:!result2! !result3!
pause>nul
:test
set /a num_tmp=%num%-%1
set /a Rnum=!num_tmp! %% 3
if !Rnum! NEQ 0 goto :eof
set Tnum_=!Tnum:%1 =!
set /a Snum=!num_tmp!/3
for %%a in (!Tnum_!) do (
set /a Rt=!Snum!-%%a
echo !Tnum_! | find "!Rt!" >nul 2>nul && (
set result3=%%a
set /a result2=!Rt!
set /a result1=%1))
#15 !
A number has a remainder of 2 when divided by 3 and a remainder of 1 when divided by 5. What is the remainder when this number is divided by 15?
@echo off
setlocal enabledelayedexpansion
echo Within 1~10000, such numbers and their remainders when divided by 15 are respectively:
for /l %%i in (1 1 10000) do (
set /a num1=%%i %% 3
set /a num2=%%i %% 5
if !num1! EQU 2 if !num2! EQU 1 (
set /a Result=%%i
set /a num=!Result! %% 15
echo Number:!Result! Remainder:!num!
)
)
pause>nul
#16 !
1. p is a prime number, and p×p+1 is also a prime number. Find 2006×p.
2. What is the remainder when the product of 2006 2s is divided by 7?
【Problem-solving idea】
1> PxP+1 is a prime number, so PxP+1 is odd (except 2), then P×P is even, so P must be even, then P=2
2> 2^2006 can be written in the form: 2^2006=8^668×2×2=(7+1)^668×4. According to the binomial theorem, the remainder of 2^2006 divided by 7 is: 4
@echo off
setlocal enabledelayedexpansion
for %%i in (2 3 5 6 7 9 10 15 17 31 33 63 65) do (
set /a tmp=1
set /a Res=1
call :test %%i
echo The remainder of 2^^^^2006 divided by %%i is:!Res!)
pause>nul
::Process even numbers
:test
if %1 GTR 2 (
set /a var=%1 %% 2
if !var! EQU 0 (
set /a num=%1/2
call :test !num!) else call :test1 %1) else set Res=0
goto :eof
:test1
for /l %%i in (1 1 10) do (
set /a tmp*=2
set /a Rnum=%1 %% 4
if !tmp! GEQ %1 (
if !Rnum! EQU 3 (
set /a Inum=%%i
set /a Inum_=2006 %% !Inum!
for /l %%a in (0 1 !Inum_!) do set /a Res*=2
set /a Res=!Res!/2
goto :eof)
set /a Inum=%%i-1
set /a Inum_=2006 %% !Inum!
for /l %%a in (0 1 !Inum_!) do set /a Res*=2
set /a Res=%1-!Res!/2
goto :eof
))
#17 !
It is said that in a holy temple in India, there is a brass plate with three gem needles inserted on it. On the first gem needle, from bottom to top, there are 64 golden plates with holes in the center, arranged from largest to smallest. The monks in the temple move the plates according to the following rules: only one plate can be moved at a time, and the small plate must always be placed on the large plate. At that time, it was said that when all 64 golden plates were moved to another gem needle, the world would be destroyed in a thunderclap. How many times does it take to move 64 golden plates to another gem needle? This is a very large number!
Answer: 18446744073709551615
【Problem-solving idea】According to relevant knowledge such as geometric sequences, it is known that the total number of times required is: 2^64-1. This number is extremely large, and direct calculation is definitely not feasible. Then we have to adopt the method of "segmented calculation in a clock-like manner". If it is not original, please forgive my rudeness!
The following code divides the data into 6 segments, each with 6 digits to save respectively. Its basic principle is: when the last segment of data is multiplied by 2, if its value is greater than 1000000, carry over, add the carried data to the previous segment of data, and so on. This segment of code currently supports the continuous multiplication of 200 2s. Of course, you can "modify" it to calculate more massive numbers.
@echo off
setlocal enabledelayedexpansion
::Initialize each segment of data;
for /l %%i in (1 1 5) do set /a num%%i=0
set /a num6=1
for /l %%i in (1 1 64) do (
rem ================================================
rem Initialize the carry data and the calculation formula of the segmented data (that is, multiply by 2)
for /l %%i in (1 1 5) do (
set /a num%%i_=0
set /a num%%i*=2)
set /a num6*=2
rem ================================================
for /l %%a in (6 -1 1) do (
rem Each segment of data saves a 6-digit number;
if !num%%a! GTR 1000000 (
set /a Inum=%%a-1
set /a tmp=!num%%a!
rem ========================================================================
rem The 1 in front is "borrowed" from the previous segment of data; adding a 1 in front is to prevent the occurrence of set /a test=0003
rem Similar situations!
set /a num%%a=1!tmp:~-6!
rem ========================================================================
rem The previous segment of data plus the carry of the current segment of data minus 1, because a 1 was "borrowed"!
set /a num!Inum!+=!tmp:~0,-6!-1
)
)
)
set /a num6-=1
rem ===================================================================
rem Tailoring work, because the previous step used the method of "borrowing" data for debugging, and now restore it!
for /l %%a in (6 -1 4) do (
set /a Inum=%%a-1
set /a tmp=!num%%a!
set num%%a=!tmp:~1!
set /a num!Inum!+=!tmp:~0,1!)
rem ===================================================================
for %%i in (%num1% %num2% %num3% %num4% %num5% %num6%) do (
if %%i neq 0 set Result=!Result!%%i)
echo !Result!
pause>nul
#18 !
There are ten RMB notes with denominations of 1 cent, 2 cents, 5 cents, 1 jiao, 2 jiao, 5 jiao, 1 yuan, 2 yuan, 5 yuan, and 10 yuan. How many different denominations can be formed?
【Problem-solving idea】According to the relevant knowledge of permutations and combinations, it is known that the total number of combinations may be: num=C(10,1)+C(10,2)+..+C(10,10)
@echo off
setlocal enabledelayedexpansion
set /a num=1
set /a Result=0
for /l %%i in (1 1 10) do (
call :test %%i 10
set /a Result+=!num! & set /a num=1)
echo The number of denominations is:!Result!
pause>nul
::Find C(n,r);
:test start_num end_num
set /a tmp=%2-%1+1
for /l %%i in (%tmp% 1 %2) do set /a num*=%%i
for /l %%i in (1 1 %1) do set /a num/=%%i

DigestI