文章标题
来源:互联网 发布:唯美画面知乎 编辑:程序博客网 时间:2024/06/16 08:01
这里写代码片#include<iostream>#include<algorithm>#include<cstdio>#include<cstring>using namespace std;typedef struct Tree{ char data; Tree *lchild,*rchild;}Node,*BTree;BTree T;int cnt,sum;char str[102];void create_tree(BTree &T){if(cnt>=sum) return;if(str[cnt]=='#') T=NULL;else{ T=new Node; T->data=str[cnt]; cnt++; T->lchild=T->rchild=NULL; create_tree(T->lchild); cnt++; create_tree(T->rchild); //cnt++;}}void cout_tree(BTree &T){if(T==NULL) return;cout_tree(T->lchild);cout<<T->data<<" ";cout_tree(T->rchild);}int main(){ while(cin>>str){ sum=strlen(str); cnt=0; create_tree(T); cout_tree(T); cout<<endl; }}
阅读全文
0 0
- 文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题 文章标题 文章标题 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- Anaconda
- Creating cluster [ERR] Node 127.0.0.1:7001 is not configured as a cluster node.
- 算法(3.4 散列表)
- 51nod1127-尺取法-最短的包括字符串
- Tekla.Structures.v2017 1DVD
- 文章标题
- [LeetCode]19. Remove Nth Node From End of List
- Codeforces Round #237 (Div. 2) 404B Marathon【精度】 好题!!!!
- C和C++的一点小区别
- C语言 printf格式控制符 完全解析
- 深入理解LinkedList
- leetcode之压缩字符串中的重复字符
- 快速排序(分治)
- spring容器创建对象的3种方式(bean的实例化)