nizhi.c
来自「数据结构基础学习程序」· C语言 代码 · 共 30 行
C
30 行
#include<stdio.h> //ni zhi hao shi le -zjd-zuihaode
#include<malloc.h>
void main()
{
struct node //dingyi jiedianleixing
{
char data;
struct node *next;
}*head,*p;
char ch;
head=NULL;
printf("please input you serial end with enter:\n");
while((ch=getchar()) && (ch!='\n'))
{
p=malloc(sizeof(struct node));//xinjian jiedian p
p->data=ch;
p->next=head;
head=p;//weicha fa jianbiao
}
printf("now show th serial after change:\n");
while(head)
{
p=head;
head=head->next;
printf("%c",p->data);
// putchar(p->data);//shuchu
free(p);
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?