Not bad. Have research on algorithms.
三人行,必有吾师焉。 学然后知不足,教然后知困,然后能自强也。
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!
DigestI
View 36,409 Replies 139
There is a five-digit odd number. Replace all 2s with 5s and all 5s with 2s in this five-digit odd number, while keeping other digits unchanged, to get a new five-digit number. If half of the new five-digit number is still 1 more than the original five-digit number, what is the original five-digit number?
The sum of five consecutive natural numbers can be divided by 2, 3, 4, 5, and 6 respectively. Find the smallest set of such numbers that meets the condition.
@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
@echo off
echo Detecting 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 consecutive 5 natural numbers are: %num0% %num1% %num2% %num3% %num4%
pause>nul
#Serial number! Solved? Unsolved
#01!
Find narcissistic numbers?
#02!
There are four numbers. When any three numbers are added together, the resulting sums are 84, 88, 99, 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 exactly consist of the ten digits from 0 to 9.
Ask, what number should this be?
#04!
A total of 4889 digits were used to number the pages of a dictionary. How many pages does this dictionary have? Answer: 1499
#05!
Acong 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?
#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 keep other numbers unchanged to get a new five-digit number. If half of the new five-digit number is still 1 greater than the original five-digit number, what is the original five-digit number?
#07!
The sum of five consecutive natural numbers can be divisible by 2, 3, 4, 5, 6 respectively. Find the smallest set of numbers that meets this condition.
#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 I was originally?
#09?
Farmer Jones said to his wife: "Hey, Maria, if I sell 75 chicks according to my way, then our chicken feed can last for 20 days. However, if I 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?
#10!
Among all five-digit numbers, how many have exactly two 3s?
#11!
Divide 17 into the sum of several natural numbers. What is the maximum product of these natural numbers?
#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, 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?
#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 of this number when 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?
Originally posted by youxi01 at 2006-11-14 18:24:
To solve this problem, first we need to clarify that the number must end with 5, because only in this way can it be an even number after conversion and be divisible by 2; and the first digit must be 2...
@echo off
setlocal enabledelayedexpansion
for /l %%i in (10001,2,99999) do (
set num=%%i
set num=!num:5=a!
if not "!num!"=="%%i" (
set num_tmp1=!num!
set num=!num:2=5!
if not "!num!"=="!num_tmp1!" (
set num=!num:a=2!
set /a num_tmp2=2*%%i+2
if !num! equ !num_tmp2! echo %%i
)
)
)
pause
@echo off
setlocal enabledelayedexpansion
for /l %%i in (10005,5,99995) do (
set num=%%i
set num=!num:5=a!
if not "!num!"=="%%i" (
set num_tmp1=!num!
set num=!num:2=5!
if not "!num!"=="!num_tmp1!" (
set num=!num:a=2!
set /a num_tmp2=2*%%i+2
if !num! equ !num_tmp2! echo %%i
)
)
)
pause
@echo off
setlocal enabledelayedexpansion
for /l %%i in (20005,5,29995) do (
set num=%%i
set num=!num:5=a!
set num=!num:2=5!
set num=!num:a=2!
set /a num_tmp=2*%%i+2
if !num! equ !num_tmp! echo %%i
)
pause