[Blue Bridge Cup] Real Exam Training 2014 C++A Group Question 2 Cut noodles

Cut noodles

topic:

A high-gluten ramen noodles, cut a knife in the middle, you can get 2 noodles.
If you fold it in half and cut it in the middle, you can get 3 noodles.
If you fold in half twice and cut in the middle, you can get 5 noodles.
So, how many noodles will you get if you fold it in half 10 times and cut it in the middle?
The answer is a whole number, please submit the answer through the browser. Do not fill in any redundant content.

Answer: 1025

 

 Problem analysis:

You can do it manually to find the pattern,

0% off-"2

1% off-"3

20% off -> 5

30% off——》9 —— 4+ 5 —— 2*3 + 1

40% off——》17 —— 8 + 9 —— 2*4 + 1

 

10% off——》2*10 + 1 = 1025

Guess you like

Origin blog.csdn.net/weixin_44566432/article/details/115195824