题目链接:https://acs.jxnu.edu.cn/problem/HDU1294
Give you two definitions tree and rooted tree. An undirected connected graph without cycles is called a tree. A tree is called rooted if it has a distinguished vertex r called the root. Your task is to make a program to calculate the number of rooted trees with n vertices denoted as Tn. The case n=5 is shown in Fig. 1.
输入:
There are multiple cases in this problem and ended by the EOF. In each case, there is only one integer means n(1<=n<=40) .
输出:
For each test case, there is only one integer means Tn.
给出树和有根的树两个定义。一个没有圆圈的无向连通的图被称为树。如果树有一个称为根的显著顶点r,则称为有根的树。你的任务是设计一个程序来计算用n个顶点的为Tn的有根的树的数量。情况n=5如图1所示。
在这个问题中有多个情况,并以EOF结束。在每种情况下,只有一个整数表示n(1<=n<=40)。
对于每个测试用例,只有一个整数表示Tn。