-
大小: 1.14MB文件類型: .zip金幣: 2下載: 0 次發布日期: 2023-08-28
- 語言: C/C++
- 標簽: C語言??codeblocks??
資源簡介
在codeblocks環境下編寫、編譯,內附實驗報告,寫的比較完整

代碼片段和文件信息
#include?
#include?
#include?
#include?
#include?
//考慮到單條宏定義對內存影響不大,因此設置了較豐富的宏定義
#define?MAXADDRESS?120//用戶輸入文件地址的最長長度
//主函數中的宏定義
#define?MAIN_INPUT?20//用于用戶輸入命令
#define?LIST_NUM?15//用于用戶輸入命令對應菜單中選項的長度
//關于結構體類型stu的定義
#define?MAXNUMBER?15//由于技術有限,此項不得超過16
#define?MAXNAME?15//由于技術有限,此項不得超過16
#define?MAXCOURSENAME?15//由于技術有限,此項不得超過16
#define?COURSENUM?3//若修改此項,請務必修改下一行的coursename
char?coursename[COURSENUM][MAXCOURSENAME]?=?{“Math“?“English“?“Computer“};//各課程的名字
typedef?struct?stu
{
????char?number[MAXNUMBER];//學號
????char?name[MAXNAME];//姓名
????float?score[COURSENUM];//各科成績
????float?aver;//平均分
????float?total;//總分
}STUDENT;
//鏈表的定義
typedef?struct?node
{
????STUDENT?student;
????struct?node?*next;
}Node;
//全局變量定義
float?aver_course[COURSENUM+2];//課程的平均分+所有學生總分的平均分+所有學生平均分的平均分
//函數聲明。具體功能參見主函數后函數定義部分
Node*?Calculate_course(Node?*head);
Node*?Sort_total_ascend(Node?*head);
Node*?Reverse_link(Node?*head);
Node*?Sort_number_ascend(Node?*head);
Node*?Sort_name_ascend(Node?*head);
Node*?Seek_name(Node?*head?char?*str);
Node*?Seek_number(Node?*head?char?*str);
void?Print_analysis(Node?*head);
void?Print_single_header(void);
void?Print_single(Node?*p);
void?Print_all(Node?*head);
int?Read_file(char?*file_address?Node?**head);
int?Save_file(char?*file_address?Node?*head);
void?Print_menu(void);
Node*?Delete_name(Node?*head?char?*str);
Node*?Delete_number(Node?*head?char?*str);
void?Scan(Node?*p);
void?Str_change(char?*p);
Node*?Append_node(Node?**head);
Node*?Delete_node(Node?*head?Node?*p);
Node*?Delete_Memory(Node?*head);
void?File_address_change(char?*file_address);
void?Gets_safe(char?*input?int?size);
//主程序
int?main()
{
????char?input[MAIN_INPUT]?=?{0};
????char?tempName[MAXNAME]?=?{0};
????char?tempNumber[MAXNUMBER]?=?{0};
????char?file_address[MAXADDRESS]?=?{0};
????Node?*head?=?NULL;
????Node?*pt;
????Print_menu();
????printf(“Welcome?to?use?this?student?achievement?management?system!?You?can?input?\“menu\“?to?call?the?menu\n“);
????printf(“I?suggest?you?always?use?\“0\“?to?exit?the?program.?This?will?back?up?the?file?you?are?editing?in?the?root?directory.\n\n“);
????while(1)
????{
????????//system(“pause“);
????????//system(“cls“);//為方便查看歷史信息,不使用這兩行代碼
????????//用戶輸入選項
?????????{
????????????printf(“Here?is?main?menu.?Please?input?your?choice:“);
????????????Gets_safe(input?sizeof(input));//相當于使用fgets,將fgets最后的\n轉化成\0,并且輸入后自動清空緩沖區
????????????printf(“\n“);
????????}
????????//查看鏈表
????????if(strcmp(input?“see“)?==?0)
????????{
????????????Print_all(head);
????????????printf(“Program?has?jumped?to?the?main?menu.\n\n“);
????????????continue;//每個功能使用結束后跳轉到“用戶輸入選項”
????????}
????????//喚出菜單
????????else?if(strcmp(input?“menu“)?==?0)
????????{
????????????Print_menu();
????????????printf(“\n“);
????????????continue;
????????}
????????//退出
????????else?if(strcmp(input?“0“)
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2019-12-17?12:30??1190201706\
?????目錄???????????0??2019-12-11?17:41??1190201706\big_homework\
?????文件????????1090??2019-12-08?10:03??1190201706\big_homework\big_homework.cbp
?????文件?????????158??2019-12-11?16:40??1190201706\big_homework\big_homework.depend
?????文件?????????356??2019-12-11?17:41??1190201706\big_homework\big_homework.layout
?????目錄???????????0??2019-12-08?10:05??1190201706\big_homework\bin\
?????目錄???????????0??2019-12-11?17:06??1190201706\big_homework\bin\Debug\
?????文件???????50650??2019-12-11?17:06??1190201706\big_homework\bin\Debug\big_homework.exe
?????文件???????28726??2019-12-11?17:06??1190201706\big_homework\main.c
?????目錄???????????0??2019-12-08?10:05??1190201706\big_homework\obj\
?????目錄???????????0??2019-12-11?17:06??1190201706\big_homework\obj\Debug\
?????文件???????23529??2019-12-11?17:06??1190201706\big_homework\obj\Debug\main.o
?????文件?????????361??2019-12-11?17:05??1190201706\big_homework\temp12138.txt
?????文件?????3046400??2019-12-17?12:29??1190201706\高級語言程序設計實驗大作業反思報告.doc
- 上一篇:LeetCode答案解析C++版本
- 下一篇:大學最新C++題庫及答案
評論
共有 條評論