🌈 style:

This commit is contained in:
lzy
2024-05-26 15:39:14 +08:00
parent 6f28a3384a
commit a57bbdb4c1
156 changed files with 765 additions and 770 deletions

View File

@@ -3,18 +3,18 @@
#include "nohead.h"
int main()
int main( )
{
int i, ret;
struct node_st *list = NULL;
struct node_st* list = NULL;
struct score_st tmp;
for (i = 0; i < 7; i++)
{
tmp.id = i;
snprintf(tmp.name, NAMESIZE, "stu%d", i);
tmp.math = rand() % 100;
tmp.chinese = rand() % 100;
tmp.math = rand( ) % 100;
tmp.chinese = rand( ) % 100;
// list = list_insert(list, &tmp);
ret = list_insert(&list, &tmp);
@@ -28,7 +28,7 @@ int main()
printf("\n\n");
int id = 13;
struct score_st *ptr;
struct score_st* ptr;
ptr = list_find(&list, id);
if (NULL == ptr)
printf("Can not find!\n");

View File

@@ -21,9 +21,9 @@ struct node_st *list_insert(struct node_st *list, struct score_st *data)
}
#endif
int list_insert(struct node_st **list, struct score_st *data)
int list_insert(struct node_st** list, struct score_st* data)
{
struct node_st *new;
struct node_st* new;
new = malloc(sizeof(*new));
if (NULL == new)
@@ -36,9 +36,9 @@ int list_insert(struct node_st **list, struct score_st *data)
return 0;
}
void list_show(struct node_st *list)
void list_show(struct node_st* list)
{
struct node_st *cur;
struct node_st* cur;
for (cur = list; NULL != cur; cur = cur->next)
{
@@ -51,9 +51,9 @@ void list_show(struct node_st *list)
}
// 删除首位
int list_delete(struct node_st **list)
int list_delete(struct node_st** list)
{
struct node_st *cur;
struct node_st* cur;
if (NULL == *list)
return -1;
@@ -66,9 +66,9 @@ int list_delete(struct node_st **list)
return 0;
}
struct score_st *list_find(struct node_st **list, int id)
struct score_st* list_find(struct node_st** list, int id)
{
struct node_st *cur;
struct node_st* cur;
if (NULL == *list)
return NULL;
@@ -91,9 +91,9 @@ struct score_st *list_find(struct node_st **list, int id)
return NULL;
}
int list_destroy(struct node_st **list)
int list_destroy(struct node_st** list)
{
struct node_st *cur;
struct node_st* cur;
if (NULL == list)
return -1;

View File

@@ -11,16 +11,16 @@ struct score_st
struct node_st
{
struct score_st data;
struct node_st *next;
struct node_st* next;
};
// struct node_st *list_insert(struct node_st *list, struct score_st *data);
int list_insert(struct node_st **list, struct score_st *data);
int list_insert(struct node_st** list, struct score_st* data);
void list_show(struct node_st *list);
void list_show(struct node_st* list);
int list_delete(struct node_st **list);
int list_delete(struct node_st** list);
struct score_st *list_find(struct node_st **list, int id);
struct score_st* list_find(struct node_st** list, int id);
int list_destroy(struct node_st **list);
int list_destroy(struct node_st** list);