103 在學生結構體資料中尋找最低分數

2021-07-03 14:00:10 字數 606 閱讀 9480

已知學生的記錄由學號和學習成績構成,n名學生的資料已存入a結構體陣列中。函式fun的功能是:找出最低的學生記錄,通過形參返回主函式。(規定只有乙個最低分數)。

#define _crt_secure_no_warnings

#include#include#define n 10

typedef struct ss

stu;

void fun(stu a, stu *s)

int main()

,,, ,,,

,,,},m;

int i;

printf("****the original data*****\n");

for (i = 0;i < n;i++)

printf("no=%s mark=%d\n", a[i].num, a[i].s);

fun(a, &m);

printf("******the result ******\n");

printf("the lowest :%s,%d\n", m.num, m.s);

system("pause");

return 0;

}

23 改變學生結構體中的資料

程式通過定義學生結構體變數,儲存了學生的學號 姓名和3門課的成績,函式fun的功能是對形參b所指結構體變數中的資料進行修改,最後在主函式中輸出修改後的資料。define crt secure no warnings include includestruct student void fun str...

在學生資訊管理系統的學習中涉及到的VB知識總結

boolean是一種資料型別 布林值 包括兩個值 true和false 當命題為真時返回true,命題為假時返回false trim 是去除字串頭或尾部的空格,但不包含中間的空格。如 private sub form click dim str1 as string dim str2 as stri...

set中怎麼放入結構體資料

include include using namespace std struct generationinfonode bool operator const generationinfonode x,const generationinfonode y return x.igenertionn...