1. <nobr id="easjo"><address id="easjo"></address></nobr>

      <track id="easjo"><source id="easjo"></source></track>
      1. 
        

      2. <bdo id="easjo"><optgroup id="easjo"></optgroup></bdo>
      3. <track id="easjo"><source id="easjo"><em id="easjo"></em></source></track><option id="easjo"><span id="easjo"><em id="easjo"></em></span></option>
          貴州做網站公司
          貴州做網站公司~專業!靠譜!
          10年網站模板開發經驗,熟悉國內外開源網站程序,包括DEDECMS,WordPress,ZBlog,Discuz! 等網站程序,可為您提供網站建設,網站克隆,仿站,網頁設計,網站制作,網站推廣優化等服務。我們專注高端營銷型網站,企業官網,集團官網,自適應網站,手機網站,網絡營銷,網站優化,網站服務器環境搭建以及托管運維等。為客戶提供一站式網站解決方案?。?!

          c語言學生信息管理系統(使用C語言編譯一個學生信息管理系統)

          來源:互聯網轉載 時間:2024-05-11 09:43:44

          具體內容如下

          /*運行環境:我是在linux里面用gcc編譯的,在windows里應該也能運行,用的一些文件庫函數都是c標準庫,沒有用linux的系統調用(糾正一下:system("clear")這個系統調用是linux的,windows里面用system("cls"))(1)問題描述學生信息包括:學號,姓名,年齡,性別,出生年月,地址,電話,E-mail等。試設計一學生信息管理系統,使之能提供以下功能:1.系統以菜單方式工作2.學生信息錄入功能(學生信息用文件保存)---輸入3.學生信息瀏覽功能——輸出4.查詢、排序功能——算法1、按學號查詢2、按姓名查詢5.學生信息的刪除與修改(可選項)(2)功能要求1.界面簡單明了;2.有一定的容錯能力,比如輸入的成績不在0~100之間,就提示不合法,要求重新輸入;3.最好用鏈表的方式實現*//*界面:-------------學生信息管理系統---------------1.學生信息錄入2.學生信息瀏覽3.學生信息查詢1.按學號查詢2.按姓名查詢4.學生信息的刪除與修改--------------------------------------------*/#include<stdio.h>#include<stdlib.h>#include<fcntl.h>#include<unistd.h>structstudent_info{ints_no;charname[20];intage;charsex[10];intbirth;charaddr[30];chartele[30];charemail[30];structstudent_info*next;};voidmenue(void);intinfo_input(void);intinfo_review(void);intinfo_search(void);intmain(void){menue();return0;}voidmenue(void){intchoose;system("clear");printf("-------------學生信息管理系統---------------\n");printf("\t\t1.學生信息錄入\n");printf("\t\t2.學生信息瀏覽\n");printf("\t\t3.學生信息查詢\n");printf("\t\t4.學生信息的刪除與修改\n");printf("\t\t0.退出系統\n");printf("--------------------------------------------\n");printf("請輸入您的選擇(0~~4):");scanf("%d",&choose);switch(choose){case0:exit(0);break;case1:info_input();break;case2:info_review();break;case3:info_search();break;}while(choose>4||choose<1){printf("您輸入了一個無效的選擇,請重新輸入(0-4):");scanf("%d",&choose);}}/*ssize_tread(intfd,void*buf,size_tcount);ssize_twrite(intfd,constvoid*buf,size_tcount);intopen(constchar*pathname,intflags,mode_tmode);FILE*fopen(constchar*path,constchar*mode);size_tfwrite(constvoid*ptr,size_tsize,size_tnmemb,FILE*stream);*/intcreat_list(void){return0;}//1.學生信息錄入intinfo_input(void){structstudent_info*head=NULL,*rear=NULL;FILE*fp;intflag=1;head=(structstudent_info*)malloc(sizeof(structstudent_info));rear=head;while(flag){structstudent_info*stu=NULL;stu=(structstudent_info*)malloc(sizeof(structstudent_info));//FILE*fopen(constchar*path,constchar*mode);fp=fopen("stuinfo.txt","a+b");fseek(fp,sizeof(structstudent_info),2);system("clear");printf("-----請依次輸入學生的信息-----\n");printf("學號:");scanf("%d",&stu->s_no);printf("姓名:");scanf("%s",stu->name);printf("年齡:");scanf("%d",&stu->age);printf("性別:");scanf("%s",stu->sex);printf("出生年月:");scanf("%d",&stu->birth);printf("地址:");scanf("%s",stu->addr);printf("電話:");scanf("%s",stu->tele);printf("E-mail:");scanf("%s",stu->email);fwrite(stu,sizeof(structstudent_info),1,fp);rear->next=stu;rear=stu;fclose(fp);printf("繼續輸入請按1,返回上一級菜單請按2,退出請按0:");scanf("%d",&flag);if(flag==0){exit(0);}if(flag==1){continue;}if(flag==2){menue();break;}}rear->next=NULL;return0;}//2.學生信息瀏覽//size_tfread(void*ptr,size_tsize,size_tnmemb,FILE*stream);intinfo_review(void){structstudent_infostu;intret=1;intflag=0;FILE*fp=fopen("stuinfo.txt","rb");//intfd=open("stuinfo.txt",O_RDONLY);if(fp==NULL){perror("fopen");exit(0);}while(ret!=0){/*返回值為1時表示讀取的字節數不足sizeof(structstudent_info),返回0表示讀取成功*//**/ret=fread(&stu,sizeof(structstudent_info),1,fp);//read(fd,stdout,sizeof(structstudent_info));printf("------------------------------------------------------------------------------------------------------\n");printf("%d\t%s\t%d\t%s\t%d\t%s\t%s\t%s\n",stu.s_no,stu.name,stu.age,stu.sex,stu.birth,stu.addr,stu.tele,stu.email);}fclose(fp);printf("=====================^-^=========================================^-^==================\n");printf("退出請按0,返回上一級菜單請按1:");scanf("%d",&flag);if(flag==0){exit(0);}if(flag==1){menue();exit(0);}return0;}//學生信息查詢intinfo_search(void){system("clear");structstudent_info*stu1=NULL,*stu2=NULL;stu1=(structstudent_info*)malloc(sizeof(structstudent_info));stu2=(structstudent_info*)malloc(sizeof(structstudent_info));intret=1,i=0,flag=1;FILE*fp=fopen("stuinfo.txt","rb");printf("=====按姓名查詢請輸入1,按學號查詢請輸入2=====\n");scanf("%d",&i);while(flag){if(i==1){printf("請輸入學生的姓名:");scanf("%s",stu1->name);do{if(ret==0){printf("沒有這個人哦^*^\n");exit(0);}ret=fread(stu2,sizeof(structstudent_info),1,fp);}while(strcmp(stu1->name,stu2->name));printf("您要找的人信息如下:\n");printf("%d\t%s\t%d\t%s\t%d\t%s\t%s\t%s\n",stu2->s_no,stu2->name,stu2->age,stu2->sex,stu2->birth,stu2->addr,stu2->tele,stu2->email);}if(i==2){printf("請輸入學生的學號:");scanf("%d",stu1->s_no);do{if(ret==0){printf("沒有這個人哦^*^\n");exit(0);}ret=fread(stu2,sizeof(structstudent_info),1,fp);}while(stu2->s_no!=stu1->s_no);printf("您要找的人信息如下:\n");printf("%d\t%s\t%d\t%s\t%d\t%s\t%s\t%s\n",stu2->s_no,stu2->name,stu2->age,stu2->sex,stu2->birth,stu2->addr,stu2->tele,stu2->email);}printf("=====繼續查詢請按1,返回上一級菜單請按2=====\n");scanf("%d",&flag);if(flag==1)continue;if(flag==2){menue();break;}}return0;}//學生信息刪除intinfo_delete(void){}//學生信息修改intinfo_alter(void){}

          還有部分功能未完成,下次再寫吧(寫的有點煩-_-)
          程序截圖:

          以上就是使用C語言編譯一個學生信息管理系統,小編相信有部分知識點可能是我們日常工作會見到或用到的。希望你能通過這篇文章學到更多知識。更多詳情敬請關注本站行業資訊頻道。

          c語言中正確的字符常量是用一對單引號將一個字符括起表示合法的字符常量。例如‘a’。數值包括整型、浮點型。整型可用十進制,八進制,十六進制。八進制前面要加0,后面...

          2022年天津專場考試原定于3月19日舉行,受疫情影響確定延期,但目前延期后的考試時間推遲。 符合報名條件的考生,須在規定時間登錄招考資訊網(www.zha...

          :喜歡聽,樂意看。指很受歡迎?!巴卣官Y料”喜聞樂見:[ xǐ wén lè jiàn ]詳細解釋1. 【解釋】:喜歡聽,樂意看。指很受歡迎。2. 【示例】:這是...

          粵貴銀開設了好多個種類:粵貴銀商品設三個種類,即粵貴銀Ag9999、粵貴銀ag9995和白銀現貨ag100G.粵貴銀買賣與此同時包括了電子盤買賣與實體交割交收,換句話說粵貴銀不但可以開展投資交易還可以開展實體交收?;涃F銀是經廣東省 *** 允許,由廣東省經濟和信息化管理聯合會審批創立,經廣東金子研究會及其省地區國營企業建立,在國務院辦公廳、中央銀行等五部委協同頒發的關于中國金融科技文檔重要批示下,...

          山東金礦在萊州和招遠市。萊州是我國重要的黃金生基地,在世界范圍內也是罕見的金礦富集區。萊州已探明的黃金儲達2000多噸,是名副其實的中國黃金儲量第一市。山東招遠市的黃金資源遍布全境,藏量豐富,招遠焦家金礦是我國重要的一處金礦產地。山東金礦在哪個城市萊州市已探明100噸以上的特大型金礦產地有3個,即萊州市朱郭李家礦區金礦、萊州市焦家深部礦區金礦、萊州市新立村礦區深部與外圍金礦。山東招遠市的金礦主要集...

          民生銀行貴賓卡額度:金卡額度: 3,000元- 50,000元;標準白金卡: 10,000元100,000元;豪華白金卡: 100,000元-30000元; 鉆石卡本卡: 300,000元及以上。具體額度由民生銀行根據提供的申請資料,以及人行記錄等綜合測評確定。申請民生信用卡的三種方式:1、電話銀行辦卡:沒有民生銀行信用卡的用戶可撥打客服熱線400-66- 95568按3#進行信用卡申;2、紙質申...

          TOP
          国产初高中生视频在线观看|亚洲一区中文|久久亚洲欧美国产精品|黄色网站入口免费进人
          1. <nobr id="easjo"><address id="easjo"></address></nobr>

              <track id="easjo"><source id="easjo"></source></track>
              1. 
                

              2. <bdo id="easjo"><optgroup id="easjo"></optgroup></bdo>
              3. <track id="easjo"><source id="easjo"><em id="easjo"></em></source></track><option id="easjo"><span id="easjo"><em id="easjo"></em></span></option>