But as a programmer, I will definitely think that if it exceeds 10 yuan, 100 yuan, it will be a bit difficult to use a pen again, but writing a simple program can solve this problem.
The result of this operation is as follows:
However, when I saw the answer, I still found that I was cheated. Some people say it's actually 20 bottles. Then the idea is that in the process of buying beer, you can give credit to the beer seller and return the bottle or bottle cap to them after buying the wine. I can't accept it. Is there such a stupid seller in the world? I gave you a bottle of wine on credit and bought a lid. From the seller's interests, it is obviously not in conformity, and it is not mentioned in the rules. However, if we follow this line of thinking, the problem seems simple.
If credit is allowed, then we can consider it this way. The buyer can finally buy a beer with 2 yuan money, and then get an empty bottle and a lid. According to the exchange rules, the price of a bottle of wine is 2 yuan.
It seems that the problem has been solved, but if credit is not allowed, can there be a simple mathematical expression to get the final result without computer simulation?
My solution is as follows:
List 1-5 yuan money first:
1 yuan, you can't buy anything.
2 yuan money, can only buy a bottle of wine.
3 yuan money can only buy a bottle of wine.
4 yuan, first buy two bottles of wine, then two bottles for one bottle of wine, and the final result is to drink three bottles of wine, 1 empty bottles, plus three lids.
5 yuan has the same money as 4 yuan.
6 yuan money, plus 2 yuan money on the basis of 4 yuan money.
4 bottles of wine +2 bottles +4 lids
5 bottles of wine+1 bottle +5 lids (exchange 2 empty bottles for 1 bottle of wine)
6 bottles of wine +2 bottles +2 lids (4 empty bottles for 1 bottle of wine)
7 bottles of wine+1 bottle +3 lids (exchange 2 empty bottles for 1 bottle of wine)
The result of 4 is 1 empty bottle +3 lids. Every time 2 yuan is added, there are 4 more bottles of wine. It can also be considered that the newly added 2 yuan money has been fully utilized, and finally there are 1 bottle and 3 lids left. So even numbers after 4 will have 1 empty bottles and 3 lids.
The final result can be calculated by formula, and n is an even number greater than 4.
It's very simple to calculate the even number first and then the odd number. Odd numbers are more than even numbers 1 yuan, and there is no other conversion method for this 1 yuan.
So odd numbers can be converted into even numbers by deducting 1 yuan.
The final conclusion is as shown above. It seems that most problems can be abstracted into mathematical problems.
"One" teacher qualification certificate music has not been tested, can I change to another major and re-test?
It should be po