VC++6.0下编程出现 unexpected end of file while looking for precompiled header directive
#include<stdio.h>#include<stdlib.h>#definemaxsize100intleafcount=0;//二叉树的二叉链表存储表示type...
#include<stdio.h>
#include<stdlib.h>
#define maxsize 100
int leafcount=0;
//二叉树的二叉链表存储表示
typedef struct BiTNode{
char data;
struct BiTNode *lchild,*rchild;
}BiTNode,*BiTree;
//栈的定义
typedef struct stack
{
int top;
BiTree stacklist[maxsize];
}stack,*sqlist;
//构造一棵二叉树
int CreateBiTree(BiTree *T)
{
char ch;
printf("输入节点:\n");
scanf("%c",&ch);
ch=getchar();
while(!((ch<='z'&&ch>='a'||ch=='0')||(ch<='Z'&&ch>='A'||ch=='0')))
{
//printf("字符非法,请重新输入\n");
ch=getchar();
}
printf("\n");
if(ch=='0')
{
*T=NULL;
}
else{
if(!(*T=(BiTree)malloc(sizeof(BiTNode)))) return 0;
(*T)->data=ch;
CreateBiTree(&((*T)->lchild));
CreateBiTree(&((*T)->rchild));
}
return 1;
}后面很长放不下了 看看头文件之类的有问题吗 展开
#include<stdlib.h>
#define maxsize 100
int leafcount=0;
//二叉树的二叉链表存储表示
typedef struct BiTNode{
char data;
struct BiTNode *lchild,*rchild;
}BiTNode,*BiTree;
//栈的定义
typedef struct stack
{
int top;
BiTree stacklist[maxsize];
}stack,*sqlist;
//构造一棵二叉树
int CreateBiTree(BiTree *T)
{
char ch;
printf("输入节点:\n");
scanf("%c",&ch);
ch=getchar();
while(!((ch<='z'&&ch>='a'||ch=='0')||(ch<='Z'&&ch>='A'||ch=='0')))
{
//printf("字符非法,请重新输入\n");
ch=getchar();
}
printf("\n");
if(ch=='0')
{
*T=NULL;
}
else{
if(!(*T=(BiTree)malloc(sizeof(BiTNode)))) return 0;
(*T)->data=ch;
CreateBiTree(&((*T)->lchild));
CreateBiTree(&((*T)->rchild));
}
return 1;
}后面很长放不下了 看看头文件之类的有问题吗 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询