Lao Wang sold apples in n days (n < = 5).For example, n is five days. On the first day, he sold half of all the apples plus half an apple; The next day, he sold one third of the remaining apples plus one third of an apple; On the third day, he sold 1/4 of the remaining apples plus 1/4 of an apple; On the fourth day, he sold 1/5 of the remaining apples and 1/5 of an apple, and on the last day, he sold the remaining 11 apples.Input n and output the number of apples at the beginning (you can't cut the apples when you sell them).The intput is an integer which is no more than 5The output is an integer.We will test 5 kinds of data. Your will get all the scores if your code pass 5 times of judge.Submit your porgram here.
Lao Wang sold apples in n days (n < = 5).For example, n is five days. On the first day, he sold half of all the apples plus half an apple; The next day, he sold one third of the remaining apples plus one third of an apple; On the third day, he sold 1/4 of the remaining apples plus 1/4 of an apple; On the fourth day, he sold 1/5 of the remaining apples and 1/5 of an apple, and on the last day, he sold the remaining 11 apples.Input n and output the number of apples at the beginning (you can't cut the apples when you sell them).The intput is an integer which is no more than 5The output is an integer.We will test 5 kinds of data. Your will get all the scores if your code pass 5 times of judge.Submit your porgram here.
发布时间:2024-09-30 13:35:23