當前位置:首頁 » 考試成績 » 數據結構學生成績管理系統

數據結構學生成績管理系統

發布時間: 2021-01-31 23:48:06

① 數據結構(學生成績管理系統)

http://wenku..com/view/dc69e8ef5ef7ba0d4a733bff.html

② 數據結構寫學生成績管理系統

#include "stdio.h"
#include "stdlib.h"
#include "string.h"
#include "windows.h"
int shoudsave=0; /* */
struct student
{
char num[10];/* 學號 */
char name[20];
char sex[4];
int cgrade;
int mgrade;
int egrade;
int totle;

③ 數據結構課程設計--學生成績管理系統

可以通過網路Hi告知我
有時間可以解決你的問題
相關的要求也可以告知我

ES:\\
交易提醒:預付定金是陷阱

④ 學生數據結構成績管理系統

要用什麼軟體實現的?

⑤ 學生成績管理系統數據結構

#include<stdio.h>
#include<stdlib.h>
int Shu;
typedef struct student
{
int num;
float mgar,cgar,egar;
float zong,ping;
}stu;

typedef struct node
{
stu xue;
struct node *next;
} LNode,*LinkList;

LinkList InitLinkList()
{
LinkList L;
L=(LinkList)malloc(sizeof(LNode));
L->next=NULL;
return L;
}

LinkList CreateTail() //尾插法,帶頭結點
{
LinkList L;
LNode *s,*r;
int i,x;
float m,c,e;
L=InitLinkList();
r=L;
x=0;
printf("輸入學生信息的個數:");
scanf("%d",&Shu);
printf("學號 數學 語文 英語\n");
while(x<Shu)
{
s=(LNode *)malloc(sizeof(LNode));
scanf("%d",&i);
s->xue.num=i;
scanf("%f",&m);
s->xue.mgar=m;
scanf("%f",&c);
s->xue.cgar=c;
scanf("%f",&e);
s->xue.egar=e;
s->xue.zong=m+c+e;
s->xue.ping=(m+c+e)/3;
s->next=NULL;
r->next=s;
r=s;
x++;
}

return (L);
}
void prn(LinkList L)
{
LNode *p;
p=L->next;
printf("\n學號 數學 語文 英語 平均成績 總成績\n");
while (p!=NULL)
{
printf("%d %0.2f %0.2f %0.2f %0.2f %0.2f\n",p->xue.num,p->xue.mgar,p->xue.cgar,p->xue.egar,p->xue.ping,p->xue.zong);
p=p->next;
}
printf("\n");
}
void prn1(LinkList L)
{
LNode *p;
int x,y;
p=L->next;
printf("請輸入要查詢的學生學號:");
scanf("%d",&x);
while(p)
{
if(x==p->xue.num )
{
y=1;
printf("\n學號 數學 語文 英語 平均成績 總成績\n");
printf("%d %0.2f %0.2f %0.2f %0.2f %0.2f\n",p->xue.num,p->xue.mgar,p->xue.cgar,p->xue.egar,p->xue.ping,p->xue.zong);
}
p=p->next;
}
if(y!=1)
printf("不存在該學生\n");
}
void xs(LinkList L)
{
LNode *p;

p=L->next;
float x,y;
printf("輸入要查詢的數學成績范圍:");
scanf("%f",&x);
scanf("%f",&y);
while(p)
{
if(p->xue.mgar>=x && p->xue.mgar<=y)
{printf("\n學號 數學 語文 英語 平均成績 總成績\n");
printf("%d %0.2f %0.2f %0.2f %0.2f %0.2f\n",p->xue.num,p->xue.mgar,p->xue.cgar,p->xue.egar,p->xue.ping,p->xue.zong);
}
p=p->next;
}
}
void ren(LinkList L)
{
LNode *p;
float m,c,e,j;
int i=0;
m=0;c=0;e=0;j=0;
p=L->next;
while(p)
{
m=m+p->xue.mgar;
c=c+p->xue.cgar;
e=e+p->xue.egar;
j=j+p->xue.ping;
p=p->next;
i++;
}

printf("班級平均成績\n");
printf("數學 語文 英語 總平均成績 總人數\n");
printf("%0.2f %0.2f %0.2f %0.2f %d",m/i,c/i,e/i,j/i,i);
}
void del(LinkList L)
{
int x;
LNode *p,*q;
p=L->next;
q=L;
printf("請輸入要刪除的學生學號:");
scanf("%d",&x);
while(p)
{
if(p->xue.num==x)
{
q->next=p->next;
break;
}
else
{
p=p->next;
q=q->next;
}
}
Shu--;
}
LinkList add(LinkList L)
{
LNode *s;
int n,i,x;
float m,c,e;
i=0;
printf("請輸入要添加的學生信息的人數:");
scanf("%d",&x);
printf("\n學號 數學 語文 英語 \n");
while(i<x)
{
s=(LinkList)malloc(sizeof(LNode));
scanf("%d",&n);
s->xue.num=n;
scanf("%f",&m);
s->xue.mgar=m;
scanf("%f",&c);
s->xue.cgar=c;
scanf("%f",&e);
s->xue.egar=e;
s->xue.zong=m+c+e;
s->xue.ping=(m+c+e)/3;
s->next=L->next;
L->next=s;
i++;
Shu++;
}
return L;
}
LinkList pxm(LinkList L)
{
printf("按數學成績排名:");
int i;
LNode *p,*q,*a;

for(i=0;i<Shu;i++)
{
p=L->next;
q=p->next;
while(q)
{
if(p->xue.mgar<=q->xue.mgar)
{
p->next=q->next;
q->next=L->next;
L->next=q;
a=p;
p=q;
q=a;
}
p=p->next;
q=q->next;
}
}
prn(L);
}
void cd()
{
printf("\t\t\t1、輸入學生信息\n");
printf("\t\t\t2、查詢學生學號信息\n");
printf("\t\t\t3、查詢學生成績信息\n");
printf("\t\t\t4、班級平均成績及人數\n");
printf("\t\t\t5、刪除學生成績\n");
printf("\t\t\t6、增加學生成績\n");
printf("\t\t\t7、學生信息排序\n"); //按數學成績排名
printf("\t請先進行操作1,按數字8可顯示全部信息,再進行其他操作\n");
printf("請輸入選項:");
}
int main()
{
int i;
LinkList L;
do
{
cd();
scanf("%d",&i);
switch(i)
{
case 1:
{
system("cls");
L=CreateTail();
prn(L);break;}
case 2:
{
system("cls");
prn1(L);
break;
}
case 3:
{
system("cls");
xs(L);break;
}
case 4:
{
system("cls");
ren(L);break;
}
case 5:
{
system("cls");
del(L);break;
}
case 6:
{
system("cls");
add(L);
prn(L); break;
}
case 7:
{
system("cls");
pxm(L); break;
}
case 8:
{
prn(L);break;
}
}}while(i<=8 && i>=1);
}
希望對你能有所幫助。

⑥ 用數據結構做 學生信息管理系統

#include <stdio.h>
#include<malloc.h>
#define NULL 0
#define LEN sizeof(struct student)
struct student
{
long num;
float score;
struct student *next;
};
int n;
struct student *creat()
{
struct student *head;
struct student *p1,*p2;
n=0;
p1=p2=(struct student*) malloc(LEN);
scanf("%ld,%f",&p1->num,&p1->score);
head=NULL;
while(p1->num!=0)
{
n=n+1;
if(n==1)head=p1;
else p2->next=p1;
p2=p1;
p1=(struct student*)malloc(LEN);
scanf("%ld,%f",&p1->num,&p1->score);
}
p2->next=NULL;
return(head);
}
void print(struct student *head)
{
struct student *p;
printf("\nNow, these %d records are:\n",n);
p=head;
if(head!=NULL)
do
{
printf("%ld%5.1f\n",p->num,p->score);
p=p->next;
}while(p!=NULL);
}
struct student *del(struct student *head,long num)
{
struct student *p1,*p2;
if (head==NULL) {printf("\nlist null!\n");
}
p1=head;
while(num!=p1->num && p1->next!=NULL)
{
p2=p1;p1=p1->next;
}
if(num==p1->num)
{
if(p1==head)head=p1->next;
else p2->next=p1->next;
printf("delete:%ld\n",num);
n=n-1;
}
else printf("%ld not been found!\n",num);
return(head);
}
struct student *insert(struct student *head,struct student *stud)
{
struct student *p0,*p1,*p2;
p1=head;
p0=stud;
if(head==NULL)
{
head=p0;p0->next=NULL;
}
else
{
while((p0->num>p1->num) && (p1->next!=NULL))
{
p2=p1;
p1=p1->next;
}
if(p0->num<=p1->num)
{
if(head==p1) head=p0;
else p2->next=p0;
p0->next=p1;
}
else
{
p1->next=p0;p0->next=NULL;
}
}
n=n+1;
return(head);
}
void main()
{
while(1)
{
struct student *head,stu;
long del_num;
printf("intput records:\n");
head=creat();
print(head);
printf("\ninput the deleted number:");
scanf("%ld",&del_num);
head=del(head,del_num);
print(head);
printf("\ninput the inserted record:");
scanf("%ld,%f",&stu.num,&stu.score);
head=insert(head,&stu);
print(head);
}
}

⑦ 數據結構鏈表c語言建立學生成績管理系統

#include<stdio.h>
#include<memory.h>
#include<stdlib.h>
#include<string.h>

typedefstructdata{
intnumber;
charname[20];
charid[20];
doublescore[3];
}dataType;

typedefstructlist{
dataTypepauline;
structlist*next;
}*LinkList,*pNode,Node;

void*getMemory(size_tsize){
returnmalloc(size);
}

LinkListgetEmptyList(){
LinkListhead=(pNode)getMemory(sizeof(Node));
memset(head,0,sizeof(Node));
returnhead;
}

intaddNode(LinkListhead,pNodepnode){
pNodeq;
for(q=head;q->next;q=q->next)
if(q->next->pauline.number==pnode->pauline.number){
printf("重復的學號:%d ",pnode->pauline.number);
return0;
}
q->next=pnode;
pnode->next=NULL;
return1;
}

//按學號升排序
voidsortNumber(LinkListhead){
pNodep,q,pt,qt;
p=head;
while(p->next){
qt=p;
q=p->next;
while(q->next){
if(qt->next->pauline.number>q->next->pauline.number)
qt=q;
q=q->next;
}
if(qt!=p){
pt=p->next;
p->next=qt->next;
qt->next=qt->next->next;
p->next->next=pt;
}
p=p->next;
}
}

//按第th門成績降排序,th=1,2,3
voidsortScore(LinkListhead,intth){
pNodep,q,pt,qt;
inti;
if(th<1||th>3)return;
i=th-1;
for(p=head;p->next;p=p->next){
qt=p;
q=p->next;
while(q->next){
if(qt->next->pauline.score[i]<q->next->pauline.score[i])
qt=q;
q=q->next;
}
if(qt!=p){
pt=p->next;
p->next=qt->next;
qt->next=qt->next->next;
p->next->next=pt;
}
}
}

voidshow(LinkListhead){
pNodep;
for(p=head->next;p;p=p->next ){
printf("%d %s %s %.2lf %.2lf %.2lf ",
p->pauline.number,p->pauline.name,p->pauline.id,
p->pauline.score[0],p->pauline.score[1],p->pauline.score[2]);
}
}

pNodereadData(){
pNodepnode=(pNode)getMemory(sizeof(Node));
inti;
printf("學號:");
scanf("%d",&pnode->pauline.number);
printf("姓名:");
scanf("%s",pnode->pauline.name);
printf("身份證:");
scanf("%s",pnode->pauline.id);
for(i=0;i<3;++i){
printf("第%d門成績:",i+1);
scanf("%lf",&pnode->pauline.score[i]);
}
returnpnode;
}

voidmenu(){
printf("******************************** ");
printf("******學生成績管理系統****** ");
printf("******************************** ");
printf("*1、添加學生信息* ");
printf("*2、顯示學生信息* ");
printf("*3、按學號排序* ");
printf("*4、按成績排序* ");
printf("******************************** ");
printf("*0、退出* ");
printf("******************************** ");
}

intmain(){
charop[20];
intselect;
LinkListhead=getEmptyList();
do{
menu();
printf("請選擇:");
fflush(stdin);
fgets(op,20,stdin);
fflush(stdin);
switch(op[0]-'0'){
case1:addNode(head,readData());break;
case2:show(head);break;
case3:sortNumber(head);break;
case4:printf("按第幾門功課排序;");
scanf("%d",&select);
sortScore(head,select);
break;
}
}while(op[0]-'0');
printf("END ");
return0;
}

⑧ 數據結構學生管理系統

#include <iostream>
#include <string>
#include <fstream>
#include <ctime>
using namespace std;
class student
{
private:
long int stu_num; //學號,宿舍號
long int stu_grade;
char stu_name[40]; //姓名
char class_name[40]; //班別
char house_name[20]; //宿舍
public:
student()
{
stu_num=0;
stu_grade=0;
stu_name[0] =0;
class_name[0] =0;
house_name[0] =0;
}
student(long a, long e, char * b,char *c,char *d)
{
Setdata(a , e , b , c, d);
}
char * Getstuname(void) //姓名查找
{
return stu_name ;
}
long Getstunum(void) //學號查找
{
return stu_num;
}
char * Gethousename(void) //宿舍號查找
{
return house_name;
}
char * Getclassname(void) //按班級查找
{
return class_name;
}
void Setdata(long a, long e, char *b,char *c,char *d)
{
stu_num = a;
stu_grade = e;
strcpy(stu_name, b);
strcpy(class_name, c);
strcpy(house_name, d);
}
void Show(void)
{
cout<<"學號:"<<stu_num<<"\t"<<"姓名:"<<stu_name<<"\t";
cout<<"數學成績:"<<stu_grade<<"\t";
cout<<"語文成績:"<<stu_grade<<"\t";
cout<<"班級:"<<class_name<<"\t\t"<<"宿舍:"<<house_name<<"\n";
}
};

void main(void)
{
student s1;
int flags=0;
long stu_num; //學號
long stu_grade;
char stu_name[40]; //姓名
char class_name[40]; //班級
char house_name[20]; //宿舍
time_t t;
time(&t);
ifstream file1;
ofstream file3;
char flag = 'y';
cout<< "---------------------------------學生管理系統-------------------------------"<<endl;
cout<< "\t\t\t 時間:" << ctime(&t);
while( flag=='y' || flag=='Y')
{ //由flag控制循環
cout<<"--------------------------------------------------------------------------------\n";
cout<<"\t\t 1:輸入學生信息!\n";
cout<<"\t\t 2:按學號查看學生信息!\n";
cout<<"\t\t 3:按宿舍號查看學生信息!\n";
cout<<"\t\t 4:按姓名查看學生信息!\n";
cout<<"\t\t 5:按班級查看學生信息!\n";
cout<<"\t\t 6:顯示全部學生信息\n";
cout<<"\t\t 7:按學號修改學生信息\n";
cout<<"\t\t 8:按學號刪除學生信息!\n";
cout<<"--------------------------------------------------------------------------------\n";
cout<<"請輸入選擇:";
char choice;
cin>>choice;
switch(choice)
{
case '1':
file3.open("c:\\stu.dat",ios::app|ios::binary);
input: flags=0;
cout<<"輸入學號:";
cin>>stu_num;
while (stu_num<100000 || stu_num>999999)
{
cin.clear();
rewind(stdin);
cout << "你輸入的學號不正確,請輸入一個六位數的學號" << endl;
cout << "學號:";
cin >> stu_num;
}
cout<<"輸入數學成績:";
cin>>stu_grade;
while (stu_grade<0 || stu_grade>100)
{
cin.clear();
rewind(stdin);
cout << "你輸入的成績不符合格式,請重新輸入百分制的成績" << endl;
cout << "成績:";
cin >> stu_grade;
}
cout<<"輸入語文成績:";
cin>>stu_grade;
while (stu_grade<0 || stu_grade>100)
{
cin.clear();
rewind(stdin);
cout << "你輸入的成績不符合格式,請重新輸入百分制的成績" << endl;
cout << "成績:";
cin >> stu_grade;
}

file1.open("c:\\stu.dat",ios::in | ios::binary | ios::beg);//按讀方式打開文件
while(!file1.eof())
{
int n;
file1.read((char *)&s1,sizeof(student));
n=file1.gcount();
if(n==sizeof(student))
{
if(s1.Getstunum()==stu_num)
flags=1;
}
}
file1.clear();
file1.close();
if (flags==1)
{
cin.clear();
cout << "學號重復,請重輸入!" << endl;
goto input;
}
cout<<"輸入姓名:"; cin>>stu_name;
cout<<"輸入班級:"; cin>>class_name;
cout<<"輸入宿舍:"; cin>>house_name;
s1.Setdata(stu_num,stu_grade,stu_name,class_name,house_name);
file3.write((char*)&s1,sizeof(s1));
file3.clear();
file3.close();
break;
case '2': //按學號查找
cout<<"請輸入學生的學號:";
cin>>stu_num;
while (stu_num<100000 || stu_num>999999)
{
cin.clear();
rewind(stdin);
cout << "你輸入的學號不正確,請輸入一個六位數的學號" << endl;
cout << "學號:";
cin >> stu_num;
}
file1.open("c:\\stu.dat",ios::in | ios::binary | ios::beg);//按讀方式打開文件
while(!file1.eof())
{
int n;
file1.read((char *)&s1,sizeof(student));
n=file1.gcount();
if(n==sizeof(student))
{
if(s1.Getstunum()==stu_num) //顯示學生信息
{
s1.Show();
flags=1;
}
}
}
file1.clear();
file1.close();
if (flags==0)
cout << "沒有找學號為:"<< stu_num <<"的學生記錄!" << endl;
flags=0;
break;
case '3': //按宿舍號查找
cout<<"請輸入宿舍號:";
cin>>house_name;
file1.open("c:\\stu.dat",ios::in | ios::binary | ios::beg);//按讀方式打開文件
while(!file1.eof())
{
int n;
file1.read((char *)&s1,sizeof(student));
n=file1.gcount();
if(n==sizeof(student))
{
if(strcmp(s1.Gethousename(),house_name)==0)
{
s1.Show();
flags=1;
}
}
}
file1.clear();
file1.close();
if (flags==0)
cout << "沒有找到宿舍為:"<< house_name <<"的學生記錄!" << endl;
flags=0;
break;
case '4': //按姓名查找
cout<<"請輸入學生姓名:";
cin>>stu_name;
file1.open("c:\\stu.dat",ios::in | ios::binary | ios::beg);//按讀方式打開文件
while(!file1.eof())
{
int n;
file1.read((char *)&s1,sizeof(student));
n=file1.gcount();
if(n==sizeof(student))
{
if(strcmp(s1. Getstuname(),stu_name)==0)
{
s1.Show();
flags=1;
}
}
}
file1.clear();
file1.close();
if (flags==0)
cout << "沒有找到姓名為:"<< stu_name <<"的學生記錄!" << endl;
flags=0;
break;
case '5': //按班級查找
cout<<"請輸入班級名稱:";
cin>>class_name;
file1.open("c:\\stu.dat",ios::in | ios::binary | ios::beg);//按讀方式打開文件
while(!file1.eof())
{
int n;
file1.read((char *)&s1,sizeof(student));
n=file1.gcount();
if(n==sizeof(student))
{
if(strcmp(s1. Getclassname(),class_name)==0)
{
s1.Show();
flags=1;
}
}
}
file1.clear();
file1.close();
if (flags==0)
cout << "沒有找到該班級為:"<< class_name <<"的學生記錄!" << endl;
flags=0;
break;
case '6': //顯示全部學生信息
file1.open("c:\\stu.dat",ios::in | ios::binary);//按讀方式打開文件
while(!file1.eof())
{
int n;
file1.read((char *)&s1,sizeof(student));
n=file1.gcount();
if(n==sizeof(student))
{
s1.Show();
flags=1;
}
}
file1.clear();
file1.close();
if (flags==0)
cout << "資料庫沒有記錄!" << endl;
flags=0;
break;
case '7': //修改學生信息按學號
flags=0;
cout<<"請輸入要修改學生的學號:";
cin>>stu_num;
while (stu_num<100000 || stu_num>999999)
{
cin.clear();
rewind(stdin);
cout << "你輸入的學號不正確,請輸入一個六位數的學號" << endl;
cout << "學號:";
cin >> stu_num;
}
file1.open("c:\\stu.dat",ios::in | ios::binary | ios::beg);//按讀方式打開文件
while(!file1.eof())
{
int n;
file1.read((char *)&s1,sizeof(student));
n=file1.gcount();
if(n==sizeof(student))
{
if(s1.Getstunum()==stu_num)
{
file3.open("c:\\stu.dat",ios::out|ios::binary);
cout<<"輸入姓名:"; cin>>stu_name;
cout<<"輸入班級:"; cin>>class_name;
cout<<"輸入宿舍:"; cin>>house_name;
s1.Setdata(stu_num,stu_grade,stu_name,class_name,house_name);
file3.write((char*)&s1,sizeof(s1));
file3.close();
flags=1;
}
}
}
file1.clear();
file1.close();
if (flags==0)
{
cout << "沒有此學生記錄,不能進行修改!" << endl;
break;
}
break;
case '8': //刪除學生信息按學號
flags=0;
cout<<"請輸入要刪除學生的學號:";
cin>>stu_num;
while (stu_num<100000 || stu_num>999999)
{
cin.clear();
rewind(stdin);
cout << "你輸入的學號不正確,請輸入一個六位數的學號" << endl;
cout << "學號:";
cin >> stu_num;
}
cout<<"刪除成功!"<<endl;
default: flag = 'n';
break;
}
}

cout << "謝謝您的使用!" << endl;
}

⑨ 數據結構課程設計 學生成績管理系統

標准答案給了

熱點內容
武漢大學學生會輔導員寄語 發布:2021-03-16 21:44:16 瀏覽:612
七年級學生作文輔導學案 發布:2021-03-16 21:42:09 瀏覽:1
不屑弟高考成績 發布:2021-03-16 21:40:59 瀏覽:754
大學畢業證會有成績單 發布:2021-03-16 21:40:07 瀏覽:756
2017信陽學院輔導員招聘名單 發布:2021-03-16 21:40:02 瀏覽:800
查詢重慶2018中考成績查詢 發布:2021-03-16 21:39:58 瀏覽:21
結業考試成績怎麼查詢 發布:2021-03-16 21:28:40 瀏覽:679
14中醫醫師資格筆試考試成績查分 發布:2021-03-16 21:28:39 瀏覽:655
名著賞析課程標准 發布:2021-03-16 21:27:57 瀏覽:881
北京大學商業領袖高端培訓課程 發布:2021-03-16 21:27:41 瀏覽:919