資源簡介
學生信息管理系統(結構體數組+鏈表版)
后面還有純數組版
代碼片段和文件信息
#include
#include
#include
#define?M?2
//定義結構體
struct?student
{
char?num[10];????????????//結構體成員變量
char?name[10];
char?gender;
int?age;
int?s1s2s3;
int?total;
};
typedef?struct?student?STU;
//函數聲明
void?input(STU?*pint?len);
void?output(STU?*pint?len);
void?searchForMaxTotal(STU?*pint?len);
void?countForGender(STU?*pint?len);
void?searchForNum(STU?*pint?len);
void?searchForAge(STU?*pint?len);
void?sortByTotal(STU?*pint?len);
void?sortByNum(STU?*pint?len);
void?pause();
void?exit(int?i);
//函數定義
void?input(STU?*pint?len)
{
int?itotal=0;
char?sex;
for(i=0;i {
printf(“請輸入第%d個同學的信息:\n“i+1);
printf(“學號:“);
gets(p->num);
printf(“姓名:“);
gets(p->name);
printf(“性別:(F/M)“);
do
評論
共有 條評論