From c6bc541ab58363d783e60a007e80e9bf9e231fda Mon Sep 17 00:00:00 2001 From: garhve Date: Mon, 5 Dec 2022 19:43:39 +0800 Subject: initialize --- .../\351\223\276\351\230\237\345\210\227/main.c" | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 "c/dataStructure/\346\240\210\345\222\214\351\230\237\345\210\227/\351\230\237\345\210\227/\351\223\276\351\230\237\345\210\227/main.c" (limited to 'c/dataStructure/栈和队列/队列/链队列/main.c') diff --git "a/c/dataStructure/\346\240\210\345\222\214\351\230\237\345\210\227/\351\230\237\345\210\227/\351\223\276\351\230\237\345\210\227/main.c" "b/c/dataStructure/\346\240\210\345\222\214\351\230\237\345\210\227/\351\230\237\345\210\227/\351\223\276\351\230\237\345\210\227/main.c" new file mode 100755 index 0000000..db5ae9a --- /dev/null +++ "b/c/dataStructure/\346\240\210\345\222\214\351\230\237\345\210\227/\351\230\237\345\210\227/\351\223\276\351\230\237\345\210\227/main.c" @@ -0,0 +1,28 @@ +#include "queue.h" + +int main(void) +{ + ElemType e; + pqueue head, tail; + InitQueue(&head); + InitQueue(&tail); + + while ((e = getchar()) != '\n') + { + EnQueue(&tail, &e); + if (EmptyQueue(&head)) + head = tail; + } + + PrintQueue(&head); + ElemType retval; + + DeQueue(&head, &retval); + printf("'%c' quit queue\n",retval); + + PrintQueue(&head); + + RsQueue(&head); + + return 0; +} -- cgit v1.2.3-70-g09d2