#include<stdio.h>
#include<stdlib.h>
typedef struct pointer//定义结构体类型指针
{
char dat;
struct pointer*link;
}pointer;
void readdata(pointer*head)//定义输入集合函数
{
pointer *p;
char tmp;
printf("输入数据,按回车键结束:");
scanf("%c",&tmp);
while(tmp!='\n')
{
p=(pointer*)malloc(sizeof(struct pointer));
p->dat=tmp;
p->link=head->link;
head->link=p;
scanf("%c",&tmp);
}
}
void pop(pointer*head)//定义输出集合函数
{
pointer *p;
p=head->link;
while(p!=NULL)
{
printf("%c",p->dat);
p=p->link;
本内容试读结束,登录后可阅读更多
下载后可阅读完整内容,剩余4页未读,立即下载