2 2 學生成績煉表處理 20分 HBU DS

2021-10-24 12:58:22 字數 1173 閱讀 3888

本題要求實現兩個函式,乙個將輸入的學生成績組織成單向鍊錶;另乙個將成績低於某分數線的學生結點從鍊錶中刪除。

struct stud_node *createlist();

struct stud_node *deletelist( struct stud_node *head, int min_score );

函式createlist利用scanf從輸入中獲取學生的資訊,將其組織成單向鍊錶,並返回煉表頭指標。鍊錶節點結構定義如下:

struct stud_node ;
輸入為若干個學生的資訊(學號、姓名、成績),當輸入學號為0時結束。

函式deletelist從以head為頭指標的鍊錶中刪除成績低於min_score的學生,並返回結果鍊錶的頭指標。

#include #include struct stud_node ;

struct stud_node *createlist();

struct stud_node *deletelist( struct stud_node *head, int min_score );

int main()

/* 你的**將被嵌在這裡 */

1 zhang 78

2 wang 80

3 li 75

4 zhao 85

080

2 wang 80

4 zhao 85

我剛開始把scanf 學號 姓名 成績放一塊了,但是最後乙個資料只輸入乙個學號(0),不輸入姓名以及成績。然後我找了半天bug!!!

/* 你的**將被嵌在這裡 */

struct stud_node *

createlist()

return l->next;

}struct stud_node *

deletelist

(struct stud_node *head,

int min_score)

else

}return l->next;

}

2 2 學生成績煉表處理 20 分

本題要求實現兩個函式,乙個將輸入的學生成績組織成單向鍊錶 另乙個將成績低於某分數線的學生結點從鍊錶中刪除。struct stud node createlist struct stud node deletelist struct stud node head,int min score 函式cre...

6 4 學生成績煉表處理(20 分)

新部落格 本題要求實現兩個功能,乙個將輸入的學生成績組織成單向鍊錶 另乙個將成績低於某分數線的學生結點從鍊錶中刪除。struct stud node createlist struct stud node deletelist struct stud node head,int min score ...

6 6 學生成績煉表處理 20分

本題要求實現兩個函式,乙個將輸入的學生成績組織成單向鍊錶 另乙個將成績低於某分數線的學生結點從鍊錶中刪除。函式介面定義 struct stud node createlist struct stud node deletelist struct stud node head,int min scor...