91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 31KB
    文件類型: .cpp
    金幣: 1
    下載: 0 次
    發布日期: 2022-04-07
  • 語言: C/C++
  • 標簽: c++??鏈表??結構體??

資源簡介

這個學生成績管理系統,由本人親自編寫,經過調試運行沒有問題,總體設計(主要功能模塊) ★ 學生信息載入模塊 ★ 學生信息創建模塊 ★ 學生信息查詢模塊 ★ 學生信息修改模塊 ★ 學生信息統計模塊 ★ 學生信息顯示模塊 ★ 學生信息保存模塊 本程序采用鏈表的形式處理學生信息,所以用結構體儲存學生的信息,每個函數模塊都相互獨立,源代碼簡單易懂,可以方便的刪除、修改、添加模塊,便于根據各種情況對程序升級,以完成任務。 感謝使用啊!

資源截圖

代碼片段和文件信息

#include?“iostream.h“
#include?“string.h“
#include?“malloc.h“
#include“stdlib.h“
#include?“fstream.h“
#include“stdio.h“
#include“iomanip.h“??
#include“conio.h“
?
#define?NULL?0
#define?LEN?sizeof(struct?STUDENT)


struct?STUDENT
{
long?number;
char?name[20];
char?sex[10];
int?age;

int?mathematicsRecord;
int?englishRecord;
int?chineseRecord;
int?physicalRecord;
????int?cRecord;
int?xuanxiuRecord;
double?average;

struct?STUDENT?*next;
};



struct?STUDENT?*?head=NULL;





void?LoadData();
void?SaveData();
void?Add();
void?Input();
void?Show();


void?FindName();
void?FindNumber();
void?FindClass();

void?Modify();
void?Del();
void?Sort();
void?FindStudentAverage();
void?FindClassAverage();
void?AboutMe();


void?LoadData(){
????char?filename[20];?
cout<<“請輸入你要讀取的文件名:?“;?
cin>>filename;?
ifstream?fin(filenameios::in);?
if(!fin)
cout<<“文件打不開?!“< else?{?
struct?STUDENT?*p1*p2;
p1=p2=(struct?STUDENT?*)malloc(LEN);
fin>>p1->number>>p1->name>>p1->sex
???>>?p1->age?>>?p1->chineseRecord?
???>>?p1->englishRecord?>>?p1->mathematicsRecord
???>>?p1->physicalRecord>>p1->cRecord?
???>>?p1->xuanxiuRecord?;
int?n=0;
while(1){
if(fin.eof())
break;
n++;
????????if(n==1)
head=p1;
????????else
????????????p2->next=p1;

????????????p2=p1;

????????????p1=(struct?STUDENT?*)malloc(LEN);
fin>>p1->number>>p1->name>>p1->sex
???????>>?p1->age?>>?p1->chineseRecord?
???????>>?p1->englishRecord?>>?p1->mathematicsRecord
???????>>?p1->physicalRecord>>p1->cRecord?
???????>>?p1->xuanxiuRecord?;
}
????????????p2->next=NULL;
cout<<“文件已讀取成功!“< }
fin.close();?
cout<<“顯示如下。“<}?

void?SaveData()?//保存函數?
{?
char?filename[20];
cout<<“請輸入文件名:?“;?
cin>>filename;?
ofstream?fout(filename);?
if(!fout)
cout<<“文件不能打開!“< else?
{?
struct?STUDENT?*p;
p=head;
do{
????????fout?<number?<name?<sex<age
?????<chineseRecord??<englishRecord?< ?????<mathematicsRecord?<physicalRecord?<cRecord?
?<xuanxiuRecord<?????????p=p->next;
}while(p?!=?NULL);
}
cout<<“保存成功!“< cout<<“將返回上一級。“< fout.close();?
getchar();?
}?




int?n=0;
void?Input(){
struct?STUDENT?*p1*p2;
char?flag=‘y‘;
p1=p2=(struct?STUDENT?*)malloc(LEN);
cout?< cout?< ?< <????cin?>>?p1->number?>>?p1->name?>>p1->sex
>>?p1->age?>>?p1->chineseRecord?
>>?p1->englishRecord?>>?p1->mathematicsRecord
>>?p1->physicalRecord>>p1->cRecord?
>>?p1->xuanxiuRecord?;

while(flag==‘y‘){
n++;
????????if(n==1)

評論

共有 條評論