b2科目四模拟试题多少题驾考考爆了怎么补救
b2科目四模拟试题多少题 驾考考爆了怎么补救

c ++链表_c遍历链表_判断链表是否有环(6)

电脑杂谈  发布时间:2017-02-20 05:19:53  来源:网络整理

#include#include#include#define N 10typedef struct nodechar name[20];struct node *link;stud;stud * creatint nstud *p,*h,*s;int i;ifhstud *mallocsizeofstudNULLprintf"不能分配内存空间!";exit0;h-name[0]'\0';h-linkNULL;ph;fori0;iN;I++ifs stud * mallocsizeofstudNULLprintf"不能分配内存空间!";exit0;p-links;printf"请输入第%d个人的姓名",i+1;scanf"%s",s-name;s-linkNULL;ps;returnh;stud * searchstud *h,char *xstud *p;char *y;ph-link;whilep!NULLyp-name;ifstrcmpy,x0returnp;else pp-link;ifpNULLprintf"没有查找到该数据!";stud * search2stud *h,char *xstud *p,*s;char *y;ph-link;sh;whilep!NULLyp-name;ifstrcmpy,x0returns;elsepp-link;ss-link;ifpNULLprintf"没有查找到该数据!";void insertstud *pchar stuname[20];stud *s;ifs stud * mallocsizeofstudNULLprintf"不能分配内存空间!";exit0;printf"\n请输入你要插入的人的姓名:";scanf"%s",stuname;strcpys-name,stuname;s-linkp-link;p-links;void delstud *x,stud *ystud *s;sy;x-linky-link;frees;void printstud *hstud *p;ph-link;printf"数据信息为:\n";whilep!NULLprintf"%s ",&*p-name;pp-link;void quitexit0;void menuvoidclrscr;printf"\t\t\t单链表C语言实现实例\n";printf"\t\t|????????????????|\n";printf"\t\t| |\n";printf"\t\t| [1] 建 立 新 表 |\n";printf"\t\t| [2] 查 找 数 据 |\n";printf"\t\t| [3] 插 入 数 据 |\n";printf"\t\t| [4] 删 除 数 据 |\n";printf"\t\t| [5] 打 印 数 据 |\n";printf"\t\t| [6] 退 出 |\n";printf"\t\t| |\n";printf"\t\t| 如未建立新表,请先建立! |\n";printf"\t\t| |\n";printf"\t\t|????????????????|\n";printf"\t\t 请输入你的选项1-6:";mainint choose;stud *head,*searchpoint,*forepoint;char fullname[20];while1menu;scanf"%d",&choose;switchchoosecase 1:headcreatN;break;case 2:printf"输入你所要查找的人的姓名:";scanf"%s",fullname;searchpointsearchhead,fullname;printf"你所查找的人的姓名为:%s",*&searchpoint-name;printf"\n按回车键回到主菜单。


本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/jisuanjixue/article-33457-6.html

相关阅读
    发表评论  请自觉遵守互联网相关的政策法规,严禁发布、暴力、反动的言论

    • 树树
      树树

      更新好还是不更新好纠结中求解

    • 马秀东
      马秀东

      f

    • 姬伯
      姬伯

      南方黑芝麻那个小孩舔碗的广告不错

    热点图片
    拼命载入中...