- 博客(8)
- 收藏
- 关注
原创 List Leaves
题目:Given a tree, you are supposed to list all the leaves in the order of top down, and left to right.Input Specification:Each input file contains one test case. For each case, the first line gives a positive integer N (≤10) which is the total number of
2020-05-25 15:05:48
130
原创 树的同构
题目:给定两棵树T1和T2。如果T1可以通过若干次左右孩子互换就变成T2,则我们称两棵树是“同构”的。例如图1给出的两棵树就是同构的,因为我们把其中一棵树的结点A、B、G的左右孩子互换后,就得到另外一棵树。而图2就不是同构的输入格式:输入给出2棵二叉树树的信息。对于每棵树,首先在一行中给出一个非负整数N (≤10),即该树的结点数(此时假设结点从0到N−1编号);随后N行,第i行对应编号第i个结点,给出该结点中存储的1个英文大写字母、其左孩子结点的编号、右孩子结点的编号。如果孩子结点为空,则在相应位
2020-05-25 15:05:19
154
原创 神、上帝以及老天爷
神、上帝以及老天爷HDU 2006’10 ACM contest的颁奖晚会隆重开始了!为了活跃气氛,组织者举行了一个别开生面、奖品丰厚的抽奖活动,这个活动的具体要求是这样的:首先,所有参加晚会的人员都将一张写有自己名字的字条放入抽奖箱中;然后,待所有字条加入完毕,每人从箱中取一个字条;最后,如果取得的字条上写的就是自己的名字,那么“恭喜你,中奖了!”大家可以想象一下当时的气氛之热烈,毕...
2020-04-25 16:50:47
155
原创 Example 3-2 WERTYU
A commom typing error is to place the hands on the keyboard one row to the right of the correct position.So that the input Q will becames the input W,the input J becames the input K and so on.Input a ...
2020-03-30 14:38:45
183
原创 vertical problem
Find all the quations that look like abc*ed,so that in the full vertical ,all the numbers belong to a particular set of numbers.set of input numbers(There is not space between adjacent numbers),outpu...
2020-03-30 14:38:26
91
原创 Fractional decimal
Enter positive integer a,b,c, the decimal from of the output a/b,to the c-decimal point.a,b<=10610^6106,c<=100.The input contains multiple sets of data,the end is marked a=b=c=0.sample input:1...
2020-03-30 14:37:47
263
原创 图案
2.5.1习题习题2-3 倒三角形Enter a positive interger n<=20,output an n-level inverted triangle(output an inverted triangle with n layers).For example,when n Equals 5,the output is as follows...
2020-03-30 14:37:29
219
原创 Puzzle
#include<stdio.h>int main(){ char a[5][5]={0}; char s[18]; char k; int i,j,p,t,i1,j1; for(i=0;i<5;i++) { for(j=0;j<5;j++) { a[i][j]=getchar(); } getchar(); //一颗赛...
2020-03-30 14:36:24
102
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人