From 649a6a2f4440878c8201bc7205734b680d6eebbe Mon Sep 17 00:00:00 2001 From: lsy2246 Date: Sat, 1 Jun 2024 18:36:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=88=5F=E6=95=B0=E7=BB=84=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- c/code/data_struct/main.c | 69 ---------------------- c/code/data_struct/queue_array.c | 56 ++++++++++++++++++ python/spider/info/weather/~$weather.xlsx | Bin 165 -> 0 bytes 3 files changed, 56 insertions(+), 69 deletions(-) delete mode 100644 c/code/data_struct/main.c create mode 100644 c/code/data_struct/queue_array.c delete mode 100644 python/spider/info/weather/~$weather.xlsx diff --git a/c/code/data_struct/main.c b/c/code/data_struct/main.c deleted file mode 100644 index a745fe9..0000000 --- a/c/code/data_struct/main.c +++ /dev/null @@ -1,69 +0,0 @@ -#include -#include - -struct link_list_struct -{ - struct link_list_struct * back_node; - int current_data; -}; - - -void add_node ( struct link_list_struct **current_node , int content ) -{ - struct link_list_struct *new_node = malloc(sizeof(struct link_list_struct)); - new_node->back_node = *current_node; - new_node->current_data = content; - *current_node = new_node; -}; - -void delete_node(struct link_list_struct **current_node){ - if(*current_node == NULL){ - printf ("当前没有结点\n"); - } - else{ - struct link_list_struct *tmp_node; - tmp_node = *current_node; - *current_node = (*current_node)->back_node; - free (tmp_node); - } -} - -void view_node(struct link_list_struct *current_node){ - if(current_node == NULL){ - printf ("当前没有结点\n"); - } - else{ - printf ("%d\n",current_node->current_data); - } -} - -int main () -{ - enum {add=1,delete,view}; - struct link_list_struct *current_node=NULL; - - while( true){ - printf ("1.增加\n"); - printf ("2.删除\n"); - printf ("3.查看\n"); - printf ("请输入:"); - int pick; - scanf_s ("%d",&pick); - if(pick==add) - { - int content; - printf ("请输入要添加的数值:"); - scanf_s ("%d",&content); - add_node (¤t_node,content); - } - else if(pick==delete) - { - delete_node(¤t_node); - } - else if(pick==view) - { - view_node (current_node); - } - } - -} \ No newline at end of file diff --git a/c/code/data_struct/queue_array.c b/c/code/data_struct/queue_array.c new file mode 100644 index 0000000..5cbe3c1 --- /dev/null +++ b/c/code/data_struct/queue_array.c @@ -0,0 +1,56 @@ +#include + +struct queue +{ + int _arr[10]; + int _head; + int _tail; + int amount; +}; + +void in_queue ( struct queue * _arr_queue , int _content ) +{ + if ( _arr_queue -> amount == 10 ) + { + printf ( "队列已满\n" ); + return; + } + _arr_queue -> _arr[ _arr_queue -> _head ] = _content; + _arr_queue -> _head = ( _arr_queue -> _head + 1 ) % 10; + _arr_queue -> amount += 1; + printf ( "%d,入队成功\n\n",_content ); +} + +void out_queue ( struct queue * _arr_queue ) +{ + if ( _arr_queue->amount == 0 ) + { + printf ( "队列为空\n\n" ); + return; + } + printf ( "%d,出队成功\n" , _arr_queue -> _arr[ _arr_queue -> _tail ] ); + _arr_queue -> _tail = ( _arr_queue -> _tail + 1 ) % 10; + _arr_queue -> amount -= 1; +} + +int main () +{ + struct queue _arr_queue={0}; + enum {_in=1,_out}; + int pick,_number; + while(1){ + printf ("1.入站\n"); + printf ("2.出站\n"); + printf ("请输入:"); + scanf_s ("%d",&pick); + if(pick==_in){ + printf ("请输入数字:"); + scanf_s ("%d",&_number); + in_queue (&_arr_queue,_number); + } + else if(pick==_out){ + out_queue (&_arr_queue); + } + } + +} \ No newline at end of file diff --git a/python/spider/info/weather/~$weather.xlsx b/python/spider/info/weather/~$weather.xlsx deleted file mode 100644 index 1e0c8b3a64122aeea8ded50bd91585a6113ab2a6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 165 ycmd;eOv%m6%PcM_N-W7QQXm%aGB`4%Fyu01GUNeqF+&MM5kn%7%m>m6REGf9mK7ZU