![(完整word版)學生學籍管理系統(tǒng)C語言程序代碼(word文檔良心出品)_第1頁](http://file3.renrendoc.com/fileroot_temp3/2021-12/4/618ac91d-570d-437a-8726-2c6a2d9587b3/618ac91d-570d-437a-8726-2c6a2d9587b31.gif)
![(完整word版)學生學籍管理系統(tǒng)C語言程序代碼(word文檔良心出品)_第2頁](http://file3.renrendoc.com/fileroot_temp3/2021-12/4/618ac91d-570d-437a-8726-2c6a2d9587b3/618ac91d-570d-437a-8726-2c6a2d9587b32.gif)
下載本文檔
版權說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權,請進行舉報或認領
文檔簡介
1、#include/標準庫頭文件#include#include#define N 100struct studentchar name10;int age;char sex5;char classnumber20;char birthday15;char homeaddress15;char hometelnum15;stuN;int load()FILE *fp;/定義文件型指針變量int i;if (fp=fopen(results.txt,rb)=NULL)/*檢查打開操作是否出錯*/printf(文件打開錯誤n);exit (0);for (i=0;!feof(fp);i+)fread
2、(&stui,sizeof(struct student),1,fp);fclose(fp);return(i-1);void save(int n)int i;FILE *fp;if (fp=fopen(results.txt,wb)=NULL)printf(文件打開錯誤:);for (i=0;in;i+)fwrite(&stui,sizeof(struct student),1,fp); fclose(fp);void add()FILE *fp;int i,k;if (fp=fopen(results.txt,wb)=NULL)printf(文件打開錯誤!n); exit
3、(1);printf(請輸入錄入信息的學生數(shù)目:); scanf(%d,&k);for (i=0;ik;i+)printf(n學號:); scanf(%s,stui.classnumber); printf(姓名:);scanf(%s,); printf(性別:);scanf(%s,stui.sex); printf(年齡:);scanf(%d,&stui.age); printf(生日:);scanf(%s,stui.birthday); printf(家庭住址:);scanf(%s,stui.homeaddress); printf(家庭電話號碼:);sc
4、anf(%s,stui.hometelnum);for (i=0;ik;i+) fwrite(&stui,sizeof(struct student),1,fp);fclose(fp);void remove()int n,i,j;char m5;n=load();printf(輸入你要刪除資料學生的姓名:); scanf(%s,&m);for (i=0;in;i+)if (!strcmp(,m)break;for (j=i;jn-1;j+)strcpy(stuj.classnumber,stuj+1.classnumber);strcpy(
5、,stuj+1.name); stuj.age=stuj+1.age;strcpy(stuj.sex,stuj+1.sex); strcpy(stuj.birthday,stuj+1.birthday);strcpy(stuj.homeaddress,stuj+1.homeaddress);strcpy(stuj.hometelnum,stuj+1.hometelnum);save(n-1);void display()int n,m; n=load();for (m=0;mn;m+)printf(學號:%sn,stum.classnumber);printf(姓名:%sn,
6、);printf(性別:%sn,stum.sex);printf(年齡:%dn,stum.age);printf(生日:%sn,stum.birthday);printf(家庭住址:%sn,stum.homeaddress); printf(家庭電話號碼:%sn,stum.hometelnum);void search()int i,x;char name_110;x=load();printf(請輸入要查找的學生姓名:n); scanf(%s,name_1);for(i=0;ix;i+)if (!strcmp(,name_1) printf(學號:%sn,stui.clas
7、snumber);printf(姓名:%sn,);printf(性別:%sn,stui.sex);printf(年齡:%dn,stui.age);printf(生日:%sn,stui.birthday);printf(家庭住址:%sn,stui.homeaddress); printf(家庭電話號碼:%sn,stui.hometelnum);void modify() FILE *fp;int n,i,j;char m10;n=load();printf(請輸入要修改學生的學號或姓名:); scanf(%s,&m);for (i=0;in;i+)if (!strcmp
8、(stui.classnumber,m)|!strcmp(,m)printf(修改項目:1.學號2.姓名3.性別4.年齡5.生日6.家庭住址7.家庭電話號碼n);printf(你選擇的項目是:);scanf(%d,&j);switch (j)case 1:printf(請輸入修改后的學號:);scanf(%s,stui.classnumber);break;case 2:printf(請輸入修改后的姓名:);scanf(%s,);break;case 3:printf(請輸入修改后的性別:);scanf(%s,stui.sex);break;case
9、 4:printf(請輸入修改后的年齡:);scanf(%d,&stui.age);break;case 5:printf(請輸入修改后的生日:);scanf(%s,stui.birthday);break;case 6:printf(請輸入修改后的家庭住址:);scanf(%s,stui.homeaddress);break;case 7:printf(請輸入修改后的家庭電話號碼:); scanf(%s,stui.hometelnum);break;default : printf(對不起,輸入錯誤!n);/*int getch();change();break;*/save(n);
10、void menu()int n;system(cls);printf(ttt歡迎使用學生學籍管理系統(tǒng)n);printf(printf(ttn); printf(ntt1)添加新生信息); printf(ntt2)刪除學生信息); printf(ntt3)顯示學生信息);printf(ntt4)查找學生信息); printf(ntt5)修改學生信息); printf(ntt6)退出系統(tǒng));printf(ntt*n);printf(ntt*n);printf(請選擇相應操作:);scanf(%d,&n);while (n6|n1)printf(操作錯誤,請重新輸入:);scanf(%d,&n);switch (n)case 1:add();break;case 2: remov
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 總經(jīng)理年會致辭15篇
- 開學典禮大會學生發(fā)言稿(5篇)
- 學校社團活動總結(jié)(合集15篇)
- 湖南省永州市高三上學期第一次模擬考試語文試題(含答案)
- 水下自激吸氣式射流裝置沖刷特性研究
- 二零二五年度社會保險停繳合同范本(國有企業(yè))3篇
- 基于FPGA的聲紋識別系統(tǒng)研究與實現(xiàn)
- 二零二五版外專局外籍教師教學成果推廣與應用合同規(guī)范3篇
- 融資租賃合同出租人取回權制度的法律問題研究
- 建筑與市政工程巡查結(jié)果的評估與總結(jié)
- 2024年云南省中考數(shù)學真題試卷及答案解析
- 工程項目采購與供應鏈管理研究
- 【視頻號運營】視頻號運營108招
- 2024年河南省五市高三第二次聯(lián)考英語試卷(含答案)
- 2024年度-脛腓骨骨折
- 應用密碼學課件
- 銳途管理人員測評試題目的
- 礦井通風安全培訓課件
- 質(zhì)量保證發(fā)展史和國外相關標準簡介
- 魯教版(五四制)七年級數(shù)學上冊期末考試卷-附帶答案
- 斯柯達野帝說明書
評論
0/150
提交評論