| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 482 人关注过本帖
标题:怎么改呀??
只看楼主 加入收藏
想你的天空
Rank: 2
等 级:新手上路
威 望:5
帖 子:610
专家分:0
注 册:2004-12-30
收藏
 问题点数:0 回复次数:1 
怎么改呀??


#include "iostream"
#include "fstream"
#include "string"
#include "stdio.h"
using namespace std;

typedef struct BiNode{
int data;
struct BiNode *left, *right;
}BiNode, *BiTree;
void CreateBiTree(BiTree &t)
{
int number;
cin>>number;
if( number == -1 ) t = NULL;
else{
if(!(t = (BiNode *)malloc(sizeof(BiNode)))) exit(1);
t->data = number;
CreateBiTree(t->left);
CreateBiTree(t->right);
}
}
void preOrder(BiTree t)
{
if(t)
{
cout<<t->data;
if(t->left!=NULL || t->right!=NULL)
{
cout<<"(";
preOrder(t->left);
cout<<",";
preOrder(t->right);
cout<<")";
}
}
}
int main()
{
BiTree t;
CreateBiTree(t);
preOrder(t);
system("pause");
return 0;
}

搜索更多相关主题的帖子: BiNode number include int 
2005-11-05 11:29
冰镇柠檬汁儿
Rank: 16Rank: 16Rank: 16Rank: 16
来 自:北京
等 级:版主
威 望:120
帖 子:8078
专家分:6657
注 册:2005-11-7
收藏
得分:0 
改什么呀?

本来无一物,何处惹尘埃
It is empty at all here, Why pm 2.5 is so TMD high!
2005-11-07 18:22
快速回复:怎么改呀??
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.016140 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved