Problem Description
There are many students in PHT School. One day, the headmaster whose name is PigHeader wanted all students stand in a line. He prescribed that girl can not be in single. In other words, either no girl in the queue or more than one girl stands side by side. The case n=4 (n is the number of children) is like
FFFF, FFFM, MFFF, FFMM, MFFM, MMFF, MMMM
Here F stands for a girl and M stands for a boy. The total number of queue satisfied the headmaster’s needs is 7. Can you make a program to find the total number of queue with n children?
Input
There are multiple cases in this problem and ended by the EOF. In each case, there is only one integer n means the number of children (1<=n<=1000)
Output
For each test case, there is only one integer means the number of queue satisfied the headmaster’s needs.
Sample Input
1
2

这是一道ACM题目,题目要求找出所有满足PHT学校校长规定的孩子排队方式,即女孩不能单独站。对于给定的孩子数量n(1<=n<=1000),你需要编写程序计算满足条件的排队组合总数。样例输入包括1, 2, 3,对应的输出是1, 2, 4。"
79771649,1010870,PyTorch获取变量名称,"['PyTorch框架', '深度学习', '编程']
最低0.47元/天 解锁文章
4141

被折叠的 条评论
为什么被折叠?



