📄 main.c
字号:
//此程序有点缺陷,最好不要把全局变量名定义为太常见的n//#include<stdio.h>#include"linked_list_function_announce.h"#include"def.h"int n;int main(){ struct student *head,*new; struct student stu; long num; int max; int flag; printf("input the max number of nodes\n"); printf("The max number should be in the scope of(1,2147483647)\n"); scanf("%d",&max); if((max>0)&&(max<2147483647)) { printf("\n*****************************************************\n"); printf("Now,the max number nodes of this chain is %d!\n",max); printf("If u want to end the chain in advance, just input 0\n"); printf("*****************************************************\n"); head=creat(max); //printf("\n1*******%p*********\n",p); printf("\nNow,these %d records are :\n\n",n); print(head); //printf("\n2*******%p*********\n",p); printf("\n************************************************\n"); printf("input the value that you want to delete!\n"); printf("************************************************\n"); scanf("%ld",&num); //printf("\n3*******%p*********\n",p); flag=n; //printf("falg is %d",flag); new=del(head,num); if(n==flag) { printf("\n************************************************\n"); printf("nothing was deleted,and the chain keeps ok!\n"); printf("************************************************\n"); } else { printf("\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"); printf("after deleting,the length of new chain is %d:\n",n); printf("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"); print(new); } ////////////////////////////////////// printf("input the inserted record\n"); scanf("%ld",&stu.num); head=insert(new,&stu); printf("\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"); printf("the new chain is :"); printf("\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"); print(head); } else printf("Input error!!\n"); return 0;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -