?? 新建 文本文檔 (2).txt
字號:
#include<stdio.h>
#define null 0
typedef struct node /*定義結構體*/
{
int data;
struct node * next;
}slnode;
void initiatels(slnode *h)
{
h=(slnode*)malloc(sizeof(slnode));
h->next=null;
}
void pushls(slnode *h,int x)
{
slnode *p;
p=(slnode*)malloc(sizeof(slnode));
p->data=x;
p->next=h->next;
h->next=p;
}
main()
{
int ch;
slnode *h,*p;
initiatels(h);
printf(">");
scanf("%d",&ch);
while(ch!=-1)
{
pushls(h,ch);
scanf("%d",&ch);
}
p=h->next;
while(p->next!=null)
{
p=h->next;
h->next=p->next;
ch=p->data;
printf("%d",ch);
}
printf("\n");
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -