Home > Back-end >  Help ahhh save me to eat eggs
Help ahhh save me to eat eggs

Time:06-05

Title description
Have N eggs, at least once a day to eat two eggs, list all sorts of ways, the order for each way according to the first day to eat egg ascending order quantity, if the first day of the same according to the second day, ascending, and so on, have to write a function, using recursive method to do!

Input format
Input data, a line of an integer, the number of eggs, range [2, 10]

The output format
Output data, a total of M, M is the total number of ways of eating eggs, each row the format of the sample, for K: - & gt; K1 - & gt; K2... Form, in which K method for which kind eat eggs, K1, K2... To eat the number of eggs every day, you must fully conform to the format

Sample data 1
Input

5
The output

1: - & gt; 2 - & gt; 3
2: - & gt; 3 - & gt; 2
3: - & gt; 5

CodePudding user response:

I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10581430.html
I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10768339.html
  • Related