函式題 學生成績煉表處理

2021-10-04 03:24:25 字數 901 閱讀 3460

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

函式介面定義:

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的學生,並返回結果鍊錶的頭指標。

輸入

1 zhang 78

2 wang 80

3 li 75

4 zhao 85080

輸出2 wang 80

4 zhao 85

#include

#include

struct stud_node ;

struct stud_node *createlist();

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

int main()

struct stud_node *createlist()

return head;

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

p=p->next;

}return head->next;

PTA函式題 學生成績煉表處理

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

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

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

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

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