c语言链表大例题.doc

时间:2015-09-07 17:19:32
【文件属性】:
文件名称:c语言链表大例题.doc
文件大小:49KB
文件格式:DOC
更新时间:2015-09-07 17:19:32
c语言 链表 c语言链表大例题.doc #include #include #include #include #define TRUE 1 #define FALSE 0 #define INPUT 1 #define SHOW 2 #define REMOVE 3 #define INSERT 4 #define SORT 5 #define REVANGE 6 #define EXIT 7 typedef struct POINT { int x, y; //x和y分别存储点的横、纵坐标值 struct POINT *next; //next用以指向下一个同类实例(节点) }POINT; POINT *InputPoints(void); void showPointLink(POINT *head); void showOnePoint(POINT); void destroyLink(POINT *head); POINT *searchPrePoint(POINT *head, int x, int y); int removePoint(POINT **head); void sortPointByX(POINT *head); POINT *revangePointLink(POINT *head); void insertPoint(POINT **head); void showMenu(void); int selectedAction(void); void sayGoodBye(void); void sayGoodBye(void) { int i; printf("\n\n\n\n\n\n"); for(i = 0; i < 3; i++) { printf(" 欢迎您的使用!\n按任意键继续...\n"); getch(); printf(" 请您多提宝贵意见!\n按任意键继续...\n"); getch(); printf(" 祝您身体健康!\n按任意键继续...\n"); getch(); printf(" 谢谢使用!\n按任意键继续...\n"); getch(); printf(" 不送了!\n按任意键继续...\n"); getch(); printf(" 请您走好!\n按任意键继续...\n"); getch(); printf(" 不要忘了我哦!!!\n按任意键继续...\n"); getch(); printf(" 再见!\n按任意键继续...\n"); getch(); } } int selectedAction(void) { int choose = 0; while(choose < 1 || choose > 7) { showMenu(); choose = getche(); if(choose < '1' || choose > '7') choose = 0; else choose -= '0'; if(choose == 0) { printf("\n 输入错误!"); printf("\n 请重新选择(1-7)"); getch(); } } return choose; }

网友评论