c語言課程設計學生課程管理
㈠ C語言課程設計----學生學籍管理系統
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
struct stud
{
long num;
char name[20];
double score;
};
typedef struct stucode
{
struct stud student ;
struct stucode *next;
}L;
void menu();
void createlist(struct stucode **r);
void out(struct stucode *r);
void search1(struct stucode *r);
void search2(struct stucode *r);
void del(struct stucode **r);
void insert(struct stucode **r);
void sort(struct stucode **r);
void main()
{
char choose;
int flag=1;
struct stucode *r=NULL;
while(flag)
{
system("cls");
menu();
choose=getchar();
switch(choose)
{
case '1':
createlist(&r);
out(r);
printf("Testing function 1\nPress any key to continue\n");
getchar();
getchar();
break;
case '2':
search1(r);
printf("Testing function 1\nPress any key to continue\n");
getchar();
getchar();
break;
case '3':
search2(r);
printf("Testing function 1\nPress any key to continue\n");
getchar();
getchar();
break;
case '4':
del(&r);
out(r);
printf("Testing function 1\nPress any key to continue\n");
getchar();
getchar();
break;
case '5':
insert(&r);
out(r);
printf("Testing function 1\nPress any key to continue\n");
getchar();
getchar();
break;
case '6':
sort(&r);
out(r);
printf("Testing function 1\nPress any key to continue\n");
getchar();
getchar();
break;
case '7':
out(r);
printf("Testing function 7\nPress any key to continue\n");
getchar();
getchar();
break;
case '0':
flag=0;
printf("The end.\n");
break;
default: printf("\nWrong Selection!(選擇錯誤,請重選!)\n");getchar();getchar();
}
}
}
void createlist(struct stucode **r)
{
struct stucode *p,*t;
long n;
char a[20];
double s;
if(*r) *r=NULL;
printf(" \n請輸入:\n 學號(請按學號升序排列) 姓名 分數 (若要結束請輸入三個為零)\n");
scanf("%ld%s%lf",&n,a,&s);
if(n==0) return;
p=(L *)malloc(sizeof(L));
p->student.num=n;
strcpy(p->student.name,a);
p->student.score=s;
p->next=NULL;
*r=p;
scanf("%ld%s%lf",&n,a,&s);
while(n)
{
t=p;
p=(L *)malloc(sizeof(L));
p->student.num=n;
strcpy(p->student.name,a);
p->student.score=s;
p->next=NULL;
t->next=p;
scanf("%ld%s%lf",&n,a,&s);
}
}
void search1(struct stucode *r)
{
long x;
if(!r)
{
printf("沒有學生信息可查詢!\n");
return ;
}
printf(" 請輸入要查詢的學生信息的學生學號:\n");
scanf("%ld",&x);
while(r&&r->student.num!=x)
r=r->next;
if(r==NULL)
printf("Error! No such student !\n");
else
printf("%ld %s %.2lf\n",r->student.num,r->student.name,r->student.score);
}
void search2(struct stucode *r)
{
char m[20];
if(!r)
{
printf("沒有學生信息可查詢!\n");
return ;
}
printf(" 請輸入要查詢的學生信息的學生姓名:\n");
scanf("%s",m);
while(r&&strcmp(r->student.name,m))
r=r->next;
if(r==NULL)
printf("Error! No such student !\n");
else
printf("%ld %s %.2lf\n",r->student.num,r->student.name,r->student.score);
}
void del(struct stucode **r)
{
long k;
struct stucode *p=*r,*t;
if(!(*r))
{
printf("沒有學生信息可刪除 !\n");
return ;
}
printf(" 請輸入要刪除的學生信息的學生學號:\n");
scanf("%ld",&k);
if(p->student.num==k)
*r=(*r)->next,free(p);
else
{
while(p->next&&p->next->student.num!=k)
p=p->next;
if(p->next==NULL)
printf("Error! No such student !\n");
else
{
t=p->next;
p->next=p->next->next;
free(t);
}
}
}
void insert(struct stucode **r)
{
long n;
char a[20];
double s;
L *p,*t,*k;
printf(" 請輸入要插入的學生信息的學生學號 姓名 分數:\n");
scanf("%ld%s%lf",&n,a,&s);
p=(L *)malloc(sizeof(L));
p->student.num=n;
p->student.score=s;
strcpy(p->student.name,a);
if(!(*r))
{
*r=p;
(*r)->next=NULL;
return ;
}
if(p->student.num<(*r)->student.num)
p->next=(*r),(*r)=p;
else
{
t=*r;
k=t;
while(t->next&&t->next->student.num<=p->student.num)
t=t->next;
p->next=t->next;
t->next=p;
*r=k;
}
}
void sort(struct stucode **r)
{
struct stucode *t,*p,*q,*z;
if(!r)
{
printf("沒有學生信息可排序!\n");
return ;
}
if(!(*r)||!(*r)->next)
return;
t=*r;
p=t->next;
t->next=NULL;
while(p)
{
q=p->next;
if(p->student.score>t->student.score)
{
p->next=t;
t=p;
}
else
{
z=t;
while(z->next&&z->next->student.score>=p->student.score)
z=z->next;
p->next=z->next;
z->next=p;
}
p=q;
}
*r=t;
}
void out(struct stucode *r)
{
printf("\n\n");
if(!r)
{
printf("沒有學生信息可輸出!\n");
return ;
}
while(r)
{
printf("%ld %s %.2lf\n",r->student.num,r->student.name,r->student.score);
r=r->next;
}
printf("\n\n");
}
void menu()
{
printf("\n 學生信息管理系統\n");
printf("\n 菜單\n\n");
printf("\n 1建立鏈表並顯示\n");
printf("\n 2查找某學號的學生信息\n");
printf("\n 3查找某姓名的學生信息\n");
printf("\n 4刪除某學號的學生信息\n");
printf("\n 5插入新的學生信息\n");
printf("\n 6按分數降序排列輸出\n");
printf("\n 7輸出\n");
printf("\n 0退出\n");
printf("\n 請選擇您要執行的選項:\n");
}
㈡ 會C語言課程設計 : 學生選課管理系統的進
學期末的作業啊………………
萬惡的作業呀………………
萬惡的程序設計呀………………
自己做做,收獲很多的。
你可以做出來,網路上會有很多熱心人幫你找出問題。但是如果你什麼都不做,當然不會有人來做啦。程序員其實是最宅最懶的一群人。。你想啊,他們連一點簡單的計算都想編代碼讓計算機自己完成,哪會幫你從頭做題目呢?
㈢ C語言課程設計 學生選課管理系統流程圖+心得
在word裡面畫啊,可以用插入圖畫,自己畫各種框圖。
冒泡排序:
(數字都是序號
1~9
為
第一到第九個數字
假如
一共9個數字比較)
1
和
2
比較
小於就交換位置
然後
1
和
3
比較
小於就交換位置
然後
1
和
4
比較
小於就交換位置
然後
......
1
和
9
比較
小於就交換位置
然後
2
和
3
比較
小於就交換位置
然後
2
和
4
比較
小於就交換位置
然後
......
2
和
9
比較
小於就交換位置
然後
3
和
4
比較
小於就交換位置
然後
3
和
5
比較
小於就交換位置
然後
....
...
8
和
9
比較
小於就交換位置
全部結束
所得序列從小到大排列
快速排列:
第一個數
跟
整個序列中間一個數比較
要是小於
就在跟前半段中間個數比較
要是又大於
就跟前半段中的後半段中間個數比較
來確定位置
如:
1
跟
(1+9)/2
比較
小於就繼續跟
(1+5)/2比較
大於就跟(5+9)/2比較
然後(假設是小於)
1跟(1+5)/2比較
又大於
那麼繼續1跟(3+5)/2比較
要是
1大於4那麼交換位置
然後第二段:
2
跟
(1+9)/2比較
小於就繼續跟
(1+5)/2比較
大於就跟(5+9)/2比較
以此類推...
9跟(1+5)/2
比較........
Dim
i
As
Integer'定義循環變數
Dim
num(1
To
20)
As
Integer'保存隨機數
Dim
max
As
Integer,
min
As
Integer'保存最大值和最小值
Me.Show
'
max
=
0:
min
=
100
'初始化
Randomize
Timer
'
For
i
=
1
To
20
num(i)
=
Fix(Rnd()
*
100)
+
1
If
num(i)
>
max
Then
max
=
num(i)
If
num(i)
<
min
Then
min
=
num(i)
Print
num(i);
Next
i
Print
Print
max
Print
min
㈣ C語言課程設計學生成績管理系統 功能:學生成績管理系統,每個學
參考以下,部分代碼改了即可:首先將記錄儲存再TXT文件下,格式如下所示:學號姓名性別等級筆試機試類別1張三男二級66772李四男三級88993張二男二級40604李二女二級50595王五女三級99996王三男二級77617劉四男四級60598劉五女二級88779張五女二級648110李六女二級5930-------------------------------------------------------------代碼如下,本人親自編寫,無錯誤通過--------------------------------------------------------------------#include#include#include#includeusingnamespacestd;voidadd_information(stringstr);voiddelete_information(stringstr);voidedit_information(stringstr);voidscanf_information(stringstr);voidscore_scanf(stringstr);voidpingfen(stringstr);voidpass_total(stringstr);main(){cout>number;stringname;//統計用的科目名switch(number){case1:cout>number;switch(number){case1:add_information(str);break;case2:delete_information(str);break;case3:edit_information(str);break;case4:scanf_information(str);break;default:cout>a>>b>>c>>d>>e>>f;outstream.precision(6);//顯示精度outstreamname_1;stringa,b,c,d,e,f;ofstreamoutstream;//暫存的中間文件outstream.open("temp.txt");boolflag=0;//是否查找到while(1){//刪除操作,自己感覺都有點麻煩instream>>a>>b>>c>>d>>e>>f;if(name_1!=a){outstreamname_1;stringa,b,c,d,e,f;ofstreamoutstream;//暫存的中間文件outstream.open("temp.txt");boolflag=0;//是否查找到while(1){//刪除操作,自己感覺都有點麻煩instream>>a>>b>>c>>d>>e>>f;if(name_1==a){//找到修改的記錄flag=1;cout>a>>b>>c>>d>>e>>f;}outstreama>>b>>c>>d>>e>>f;coutname_1;stringa,b,c,d,e,f,g;boolflag=0;//是否查找到while(1){//刪除操作,自己感覺都有點麻煩instream>>a>>b>>c>>d>>e>>f>>g;if(name_1==g){//找到修改的記錄flag=1;couta>>b>>c>>d>>e>>f;outstream=85)outstream=70&&f=60&&f=70&&e=70)outstream=60&&f=60&&e=60)outstreama>>b>>c>>d>>e>>f>>g;if(g=="優秀"||g=="良好"||g=="及格")count++;if(instream.eof())break;}cout<<"合格的人數為:"<
㈤ c語言課程設計之學生成績管理系統設計的程序
#include<stdio.h>
#include<conio.h>
#include <stdlib.h>
#include<string.h>
#define MAX 80
#define max 3
int nu=0;
struct classname
{
char name[20];
float score;
};
struct student
{
char no[20];
char std_name[20];
struct classname km[max];
float ave;
float sum;
int save;
};
struct student stu[MAX],*p;
void chushi()
{
int i,j;
for(i=0;i<MAX;i++)
{
for(j=0;j<20;j++)
{
stu[i].no[j]=NULL;
stu[i].std_name[j]=NULL;
stu[i].km[j].name[j]=NULL;
stu[i].km[j].score=0;
}
stu[i].ave=0;
stu[i].sum=0;
stu[i].save=0;
}
}
void av()/*求平均值*/
{
int i;
for(i=0;i<nu;i++)
{
stu[i].sum=stu[i].km[1].score+stu[i].km[2].score+stu[i].km[3].score;
stu[i].ave=stu[i].sum/3;
}
}
void first_check()
{
FILE *p;
int i,j;
struct classname frist[max];
for(i=0;i<max;i++)
{
for(j=0;j<20;j++)
frist[i].name[j]=NULL;
frist[i].score=0;
}
if ((p=fopen("c:\\kemu.txt","r"))==NULL)
{
printf("您好,歡迎使用學生成績管理系統\n\n因為您是第一次使用,請輸入科目名稱(三科)\n\n");
p=fopen("c:\\kemu.txt","w");
printf("輸入課程1名稱:");
scanf("%s",frist[0].name);
fprintf(p,"%s\n",frist[0].name);
printf("輸入課程2名稱:");
scanf("%s",frist[1].name);
fprintf(p,"%s\n",frist[1].name);
printf("輸入課程3名稱:");
scanf("%s",frist[2].name);
fprintf(p,"%s\n",frist[2].name);
}
system("cls");
fclose(p);
}
void save_nu()
{
FILE *p;
p=fopen("c:\\renshu.txt","w");
fprintf(p,"%d\n",nu);
fclose(p);
}
void Save_add(int n)
{
FILE * p;
int i;
p= fopen("c:\\cheji.txt","at");
if (p == NULL)
{
printf("文件不存在!!\n");
exit(0);
}
save_nu();
for (i = 0;i<n;i++)
if(stu[i].save==1)
{
stu[i].sum=stu[i].km[1].score+stu[i].km[2].score+stu[i].km[3].score;
stu[i].ave=stu[i].sum/3;
fprintf(p,"%s %s %2.1f %2.1f %2.1f %2.1f %2.1f \n",stu[i].no,stu[i].std_name,stu[i].km[0].score,stu[i].km[1].score,stu[i].km[2].score,stu[i].ave,stu[i].sum);
}
fclose(p);
}
void Save()
{
FILE * p;
int i;
p= fopen("c:\\cheji.txt","w");
if (p == NULL)
{
printf("文件不存在!!\n");
exit(0);
}
save_nu();
for (i = 0;i<nu;i++)
if(stu[i].save==1)
{
av();
fprintf(p,"%s %s %2.1f %2.1f %2.1f %2.1f %2.1f \n",stu[i].no,stu[i].std_name,stu[i].km[0].score,stu[i].km[1].score,stu[i].km[2].score,stu[i].ave,stu[i].sum);
}
fclose(p);
}
int read_nu()
{
FILE *p;
char ch,s[10]={'\0'};
int i=0;
p=fopen("c:\\renshu.txt","r");
if(p==NULL)
{
save_nu();
return 0;
}
ch=fgetc(p);
while(ch!='\n')
{
s[i]=ch;
ch=fgetc(p);
i++;
}
nu=atoi(s);
fclose(p);
return 0;
}
int read_km()
{
FILE *p;
int i,j=0;
char s[20]={'\0'};
chushi();
p=fopen("c:\\kemu.txt","r");
if(p==NULL)
{
printf("ERROR read_km");
return 0;
}
fgets(s,20,p);
while(strlen(s)!=0)
{
for(i=0;i<strlen(s);i++)
if(s[i]==10)
{
s[i]='\0';
break;
}
for(i=0;i<=nu;i++)
strcpy(stu[i].km[j].name,s);
for(i=0;i<20;i++)
s[i]='\0';
j++;
fgets(s,20,p);
}
}
void read()
{
FILE *p;
int i,j,n,k,z=0;
char s[50]={'\0'};
char o[10]={'\0'};
p=fopen("c:\\cheji.txt","r");
if(p==NULL)
printf("ERROR_read");
chushi();
read_km();
fgets(s,50,p);
while(strlen(s)!=0)
{
j=0;
for(i=0;i<50;i++)
{
if(s[i]!='\n')
{
n=0;
while(j==0)
{
if(s[i]!=' ')
{
stu[z].no[n]=s[i];
n++;i++;
}
else
break;
}
while(j==1)
{
if(s[i]!=' ')
{
stu[z].std_name[n]=s[i];
n++;i++;
}
else
break;
}
while(j==2)
{
if(s[i]!=' ')
{
o[n]=s[i];
n++;i++;
}
else
{
stu[z].km[0].score=atoi(o);
break;
}
}
while(j==3)
{
if(s[i]!=' ')
{
o[n]=s[i];
n++;i++;
}
else
{
stu[z].km[1].score=atoi(o);
break;
}
}
while(j==4)
{
if(s[i]!=' ')
{
o[n]=s[i];
n++;i++;
}
else
{
stu[z].km[2].score=atoi(o);
break;
}
}
while(j==5)
{
if(s[i]!=' ')
{
o[n]=s[i];
n++;i++;
}
else
{
stu[z].ave=atoi(o);
break;
}
}
while(j==6)
{
if(s[i]!=' ')
{
o[n]=s[i];
n++;i++;
}
else
{
stu[z].sum=atoi(o);
break;
}
}
for(k=0;k<10;k++)
o[k]='\0';
}
else
break;
j++;
}
for(i=0;i<50;i++)
s[i]='\0';
fgets(s,50,p);
z++;
}
}
void putin()
{
int n,i=0;
char ch;
read_km();
do
{
printf("\t\t\t\t錄入學員信息\n輸入第%d個學員的信息\n",i+1);
printf("\n輸入學生編號:");
scanf("%s",stu[i].no);
printf("\n輸入學員姓名:");
scanf("%s",stu[i].std_name);
printf("\n輸入課程%s的分數:",stu[0].km[0].name);
scanf("%f",&stu[i].km[0].score);
printf("\n輸入課程%s的分數:",stu[0].km[1].name);
scanf("%f",&stu[i].km[1].score);
printf("\n輸入課程%s的分數:",stu[0].km[2].name);
scanf("%f",&stu[i].km[2].score);
stu[i].save=1;
printf("\n\n");
i++;
n=i;
printf("是否繼續輸入?(Y/N)");
fflush(stdin);
ch=getch();
system("cls");
}
while(ch!='n'&&ch!='N');
system("cls");
if(nu==0)
{
nu=n;
Save();
}
else
{
nu=n+nu;
Save_add(n);
}
}
int putout()
{
int i;char s;
if(nu==0)
{
printf("學生信息為零!請錄入...");
return 0;
}
read();
do
{
printf("學生成績信息:\n\n");
for(i=0;i<nu;i++)
printf("學號:%s 姓名:%s\n%s分數:%2.1f\t%s分數:%2.1f\t%s分數:%2.1f\n平均分數:%2.1f\t總成績:%2.1f\n\n",stu[i].no,stu[i].std_name,stu[i].km[0].name,stu[i].km[0].score,stu[i].km[1].name,stu[i].km[1].score,stu[i].km[2].name,stu[i].km[2].score,stu[i].ave,stu[i].sum);
printf("\t\t按任意鍵返回主菜單");
fflush(stdin);
s=getch();
}
while(!s);
system("cls");
}
int sort()/*排序數據函數*/
{
struct student temp;
int i,j;
char s;
if(nu==0)
{
printf("學生信息為零!請錄入...");
return 0;
}
chushi();
read();
for(i=1;i<nu;i++)
{
for(j=1;j<=nu-i;j++)
{
if(stu[j-1].ave<stu[j].ave)
{
temp=stu[j];
stu[j]=stu[j-1];
stu[j-1]=temp;
}
}
}
do
{
printf("學生成績信息:\n\n");
for(i=0;i<nu;i++)
printf("學號:%s 姓名:%s 平均成績:%2.1f\n\n",stu[i].no,stu[i].std_name,stu[i].ave);
printf("\t\t按任意鍵返回主菜單");
fflush(stdin);
s=getch();
}
while(!s);
system("cls");
}
void find()/*查詢函數*/
{
int j,i=0;
int c=0;
char search[10]={'\0'};
char as;
if(nu==0)
{
printf("學生信息為零!請錄入...");
return 0;
}
chushi();
read();
do
{
printf("輸入要查詢課程名稱:");
scanf("%s",search);
for(j=0;j<max;j++)
if(!strcmp(stu[i].km[j].name,search))
{
c=1;
printf("\n該課程不及格學生姓名:\n");
for(i=0;i<nu;i++)
if(stu[i].km[j].score<60)
printf("%s\n",stu[i].std_name);
}
if(c==0)
printf("無此課程!");
printf("\n\t\t按任意鍵返回主菜單");
fflush(stdin);
as=getch();
}
while(!as);
system("cls");
}
void tongji()
{
int j,m,z,i=0;
char s;
if(nu==0)
{
printf("學生信息為零!請錄入...");
return 0;
}
chushi();
read();
for(z=0;z<max;z++)
{
m=stu[i].km[z].score;j=0;
printf("%s 最高分: ",stu[i].km[z].name);
for(i=0;i<nu;i++)
if(m<stu[i].km[z].score)
{
m=stu[i].km[z].score;
j=i;
}
printf("%s\t",stu[j].std_name);
j=0;i=0;m=stu[i].km[z].score;
printf("%s 最低分: ",stu[i].km[z].name);
for(i=0;i<nu;i++)
if(m>stu[i].km[z].score)
{
m=stu[i].km[z].score;
j=i;
}
printf("%s\t",stu[j].std_name);
m=0;j=0;i=0;
printf("%s 平均分: ",stu[i].km[z].name);
for(i=0;i<nu;i++)
m=m+stu[i].km[z].score;
printf("%d\n",m/nu);
m=0;i=0;
printf("%s 分數低於的60人數: ",stu[i].km[z].name);
for(i=0;i<nu;i++)
if(stu[i].km[z].score<60)
m++;
printf("%d\t",m);
m=0;j=0;i=0;
printf("%s 分數高於60的人數: ",stu[i].km[z].name);
for(i=0;i<nu;i++)
if(stu[i].km[z].score>60)
m++;
printf("%d\n\n",m);
}
do
{
printf("\t\t按任意鍵返回主菜單");
fflush(stdin);
s=getch();
}
while(!s);
system("cls");
}
void main()/*主函數*/
{
int as;
first_check();
start: printf("\n\t\t\t歡迎使用學生成績管理系統\n");
/*一下為功能選擇模塊*/
do
{
printf("\n\t\t\t\t1.錄入學員信息\n\t\t\t\t2.顯示學員信息\n\t\t\t\t3.成績排序信息\n\t\t\t\t4.查詢不及格學生\n\t\t\t\t5.統計信息\n\t\t\t\t6.退出\n");
printf("\t\t\t\t選擇功能選項:");
fflush(stdin);
read_nu();
scanf("%d",&as);
switch(as)
{
case 1:system("cls");putin();break;
case 2:system("cls");putout();break;
case 3:system("cls");sort();break;
case 4:system("cls");find();break;
case 5:system("cls");tongji();break;
case 6:system("exit");exit(0);
default:system("cls");goto start;
}
}
while(1);
/*至此功能選擇結束*/
}
㈥ 急求C語言課程設計:學生成績管理程序
#include<stdio.h>
#include<string.h>
#define LIST_INIT_SIZE 10
#define INCREAMENT 5
#define TRUE 1
#define FALSE 0
#define ERROR 0
#define OVERFLOW -2
#define OK 1
#define LT(a,b) ((a)<(b))
int i,j,low,high;
typedef int Status;
typedef struct
{int seat;
char name[7];
char sex[7];
int year;
int score[3];
int total;
float average;
}rec;
typedef struct
{rec *stu;
int length;
int listsize;
}SqList;
typedef struct
{int grade;
int lowest;
int highest;
double ave;
int nam;
}dis;
typedef struct
{dis *sco;
int len;
int size;
}Dis;
Status InitList_Sq(SqList *L)
{(*L).stu=(rec *)malloc(LIST_INIT_SIZE*sizeof(rec));
if(!(*L).stu) exit (OVERFLOW);
(*L).length=5;
(*L).listsize=10;
return OK;
}
Status List_Sq(Dis *S)
{(*S).sco=(dis *)malloc(LIST_INIT_SIZE*sizeof(dis));
if(!(*S).sco) exit (OVERFLOW);
(*S).len=3;
(*S).size=10;
return OK;
}
Status Insert(SqList *L)
{int g;
printf("\nHow many students you want to input:");
scanf("%d",&g);
for(i=(*L).length+1;i<=(*L).length+g;i++)
{if((*L).listsize<=(*L).length)
{(*L).stu=(int *)realloc((*L).stu,((*L).listsize+INCREAMENT)*sizeof(int));
if(!(*L).stu)exit(OVERFLOW);
(*L).listsize+=INCREAMENT;
}
printf("please input student'infmation:");
printf("\nxue hao:");
scanf("%d",&(*L).stu[i].seat);
printf("\nname:");
scanf("%s",&(*L).stu[i].name);
printf("\nsex:");
scanf("%s",&(*L).stu[i].sex);
printf("\nyear:");
scanf("%d",&(*L).stu[i].year);
printf("\ngrades of three disciplines:");
for(j=0;j<3;j++)
scanf("%d",&(*L).stu[i].score[j]);
}
(*L).length+=g;
}
Status Delete(SqList *L,int i)
{rec *p,*q;
rec *e;
if((i<1)||(i>(*L).length))return ERROR;
p=&((*L).stu[i]);
*e=*p;
q=(*L).stu+(*L).length;
for(++p;p<=q;++p)*(p-1)=*p;
--(*L).length;
return OK;
}
Computing(SqList *L)
{for(i=0;i<=(*L).length;i++)
{(*L).stu[i].total=(*L).stu[i].score[0]+(*L).stu[i].score[1]+(*L).stu[i].score[2];
(*L).stu[i].average=(*L).stu[i].total/3;
}
return OK;
}
void BInsertSort(SqList *L)
{int m;
for(i=2;i<=(*L).length;++i)
{(*L).stu[0]=(*L).stu[i];
low=1;
high=i-1;
while(low<=high)
{m=(low+high)/2;
if(LT((*L).stu[0].seat,(*L).stu[m].seat)) high=m-1;
else low=m+1;
}
for(j=i-1;j>=high+1;--j) (*L).stu[j+1]=(*L).stu[j];
(*L).stu[high+1]=(*L).stu[0];
}
}
int Partion(SqList *L,int low ,int high)
{int pivotkey;
(*L).stu[0]=(*L).stu[low];
pivotkey=(*L).stu[low].total;
while(low<high)
{while(low<high&&(*L).stu[high].total>=pivotkey) --high;
(*L).stu[low]=(*L).stu[high];
while(low<high&&(*L).stu[low].total<=pivotkey) ++low;
(*L).stu[high]=(*L).stu[low];
}
(*L).stu[low]=(*L).stu[0];
return low;
}
int QSort(SqList *L, int low,int high)
{int pivotloc;
if(low<high)
{pivotloc=Partion(&(*L),low,high);
QSort(&(*L),low,pivotloc-1);
QSort(&(*L),pivotloc+1,high);
}
}
int Com(Dis *S,SqList *L)
{int g;
for(j=0;j<3;j++)
{(*S).sco[j].highest=(*L).stu[1].score[j];
(*S).sco[j].lowest=(*L).stu[1].score[j];
(*S).sco[j].grade=0;
}
(*S).sco[0].nam=1;
(*S).sco[1].nam=2;
(*S).sco[2].nam=3;
for(j=0;j<(*S).len;j++)
{for(i=0;i<(*L).length;i++)
{(*S).sco[j].grade+=(*L).stu[i+1].score[j];
if((*S).sco[j].highest<(*L).stu[i+1].score[j])
(*S).sco[j].highest=(*L).stu[i+1].score[j];
if((*S).sco[j].lowest>(*L).stu[i+1].score[j])
(*S).sco[j].lowest=(*L).stu[i+1].score[j];
}
(*S).sco[j].ave=(*S).sco[j].grade/(*L).length;
}
printf("\nPlease input the discipline:1.Math 2.English 3.Program design");
scanf("%d",&g);
for(i=0;i<3;i++)
if((*S).sco[i].nam==g)
print_3(&(*S),i);
}
print_1(SqList *L)
{int i;
printf("\nseat name sex year Math English Program\n");
for(i=1;i<=(*L).length;i++)
{printf("%d %s %s %d %d %d %d\n",(*L).stu[i].seat,(*L).stu[i].name,(*L).stu[i].sex, (*L).stu[i].year,(*L).stu[i].score[0],(*L).stu[i].score[1],(*L).stu[i].score[2]);
}
return OK;
}
print_2(SqList *L)
{int i;
printf("\nseat name sex year Math English Program total averge\n");
for(i=(*L).length;i>=1;i--)
{printf("%d %s %s %d %d %d %d %d %f\n",(*L).stu[i].seat,(*L).stu[i].name,(*L).stu[i].sex, (*L).stu[i].year,(*L).stu[i].score[0],(*L).stu[i].score[1],(*L).stu[i].score[2],(*L).stu[i].total,(*L).stu[i].average);
}
return OK;
}
print_3(Dis *S,int g)
{printf("\nThe average:%lf",(*S).sco[g].ave);
printf("\nThe highest:%d",(*S).sco[g].highest);
printf("\nThe lowest:%d",(*S).sco[g].lowest);
}
print(SqList *L,int i)
{
printf("\nseat name sex year Math English Program\n");
printf("%d %s %s %d %d %d %d\n",(*L).stu[i].seat,(*L).stu[i].name,(*L).stu[i].sex, (*L).stu[i].year,(*L).stu[i].score[0],(*L).stu[i].score[1],(*L).stu[i].score[2]);
return OK;
}
main()
{SqList L;
Dis S;
int i,j,k;
i=InitList_Sq(&L);
if(i)
{rec s[5]={{103,"zhao","male ",19,80,90,75},
{102,"qian","female",20,85,82,69},
{105,"sun ","male ",20,90,56,81},
{104,"li ","male ",20,89,78,88},
{101,"zhou","female",19,78,79,86}};
for(i=0;i<5;i++)
{L.stu[i+1]=s[i];
}
}
print_1(&L);
while(1)
{printf("Please choose to search:1.Insert 2.delete 3.sort according to xuehao 4.continue");
scanf("%d",&k);
if(k==1)
{Insert(&L);
print_1(&L);
}
if(k==2)
{printf("Please input the student's xue hao you want to delete\n");scanf("%d",&j);
for(i=1;L.stu[i].seat!=j&&i<=L.length;i++);
if(i<=L.length) {Delete(&L,i);print_1(&L);}
else printf("There is none of the person\n");
}
if(k==3)
{BInsertSort(&L);
print_1(&L);
}
if(k==4) break;
getch();
}
List_Sq(&S);
while(1)
{printf("\nPlease choose 1.the sort of total 2.one subject 3.search 4.leave");
scanf("%d",&k);
if(k==1)
{Computing(&L);
QSort(&L,1,L.length);print_2(&L);
}
if(k==2)Com(&S,&L);
if(k==3)
{printf("Please input the student's xue hao you want to search:");scanf("%d",&j);
for(i=1;L.stu[i].seat!=j&&i<=L.length;i++);
if(i<=L.length) print(&L,i);
else printf("There is none of the person\n");
}
if(k==4) break;
}
}還有 這個C語言學得好的話真的很好玩的 要認真學啊同學
㈦ C語言課程設計學生信息管理系統
我沒測試程序的各個功能,只是在
Visual
Studio
6.0
能運行了~~~,共三個文件如下:student.hdegree.cppmain.cpp
㈧ C語言課程設計 設計題目管理系統
你好,源代碼,實現你所要求的,需要了就聊我
㈨ c語言課程設計學分管理程序
程序設計基礎實訓
項目名稱:
學生學分管理
系 別: 計算機工程系
專 業: 計算機網路技術
班 級: 0922211
學生姓名:
指導教師: 韋立蓉
北 京 信 息 職 業 技 術 學 院
2010年 1 月 日
一、項目背景介紹
(概要介紹此項目設計的意義和要求)
本程序為學生學分管理系統。本程序根據現實中的問題通過c語言形式編程。本程序要求能夠登記學分,顯示學分查詢學分,修改學分,刪除學分,統計學分。
二、程序功能描述:
(描述基本程序中每個函數的功能,給處各函數流程圖)
1、
登記單流程圖
2、
顯示學分流程圖
3、
查詢學分流程圖
4、
修改信息流程圖
5、
刪除信息流程圖
6、
統計信息流程圖
三、設計方案介紹
(基本思想函數調用的思路介紹)
1、主流程圖
2、界面設計
(界面設計,函數的定義,功能設計、,羅列出所有需要解決的問題
函數調用問題,循環問題,查找問題,修改問題,查詢問題,刪除問題,比較問題。
3、變數定義
序號 變數名 變數性質(局部/全局) 功能 作用范圍
1 typedef 全局 定義結構體類型 整體
2 Int 全局 定義五門課類型 整體
... Char 全局 定義學號班級姓名類型 整體
5、函數調用的類型
四、測試與分析
(簡要介紹測試的作用及意義)
測試可以知道所編寫的程序是否可行,通過實際的測試可以找出程序是否符合現實。通過測試和反復修改可以使程序更加人性化。
(一)測試列表
(以表格的形式給出,不少於10個)
測試數據或執行操作 執行結果 是否正確 測試人簽名
調用主菜單 顯示了主菜單 正確
選擇主菜單里的1 請輸入學生學生信息…. 正確
輸出 有重復有亂碼 否
查詢 無 否
修改 按學號修改……. 是
按學號查詢 顯示了該信息 是
按班級查詢 只顯示里一名同學的信息 否
按學好刪除 刪除成功 是
須補考基礎課的 所有學生信息都顯示 否
可升學學生 顯示了該顯示的信息 是
(二)測試結果分析
(根據以下表格,如實填寫並簽名)
bug個數 錯誤類型 錯誤原因分析 是否修改 設計者簽名
1 與count聲名中的類型不匹配 少了void count() 是
2 錯誤 jia.c 19: 表達式語法錯在 main 函數中 Scanf中少了&s 是
4 錯誤 jia.c 31: do語句中必須有while關鍵字在 main 函數中 沒寫while 是
5 錯誤 jia.c 30: 未定義的符號's'在 main 函數中 上面沒int I; 是
6 錯誤 1.c 335: 表達式語法錯在 count 函數中 Switch() 括弧里沒有變數 是
7
五、實訓總結
(總結實訓過程中的所使用的知識和已實現的功能,總結自己掌握理論知識和動手能力的程度,提出自己的不足之處及改進措施)
通過這一周的實訓。我們充分運用了所學的東西編出了解決實際問題的程序。我們運用了函數的調用,循環,定義,比較,查找,刪除等知識。通過實際動手,我更加深入的了解了課本上的知識。同時提高了我的動手能力。
實訓中我找到了我許多的不足,以前我遇到不董的就會直接去問別人,不獨自思考。試訓中我學會了獨自思考和團隊合作。雖然我在編程當中遇到許多問題,但經過獨自思考和學習解決了問題。最後編出了管理程序。
C語言學生學分管理程序代碼
typedef struct student
{ char num[11],name[7],class[10];
int jichu,renwen,xuanxiu,zhuanye,shiyan;
}STU;
STU st[37];
static int n;
void menu();
void input();
void print();
void query();
void modi();
void del();
void count();
main()
{ int s;
do{
menu();
printf("\n\t\t\t\t 請選擇:");
scanf("%d",&s);
switch(s)
{ case 0:break;
case 1:input();break;
case 2:print();break;
case 3:query();break;
case 4:modi();break;
case 5:del();break;
case 6:count();break;
default:printf("選擇無效!");
}
}while(s!=0);
getch();
}
void menu()
{ clrscr();
printf("\t\t\t****************************\n");
printf("\t\t\t********歡迎您的使用********\n");
printf("\t\t\t******學生學分管理程序******\n");
printf("\t\t\t*** 1-登記學生學分 ***\n");
printf("\t\t\t*** 2-顯示學生學分 ***\n");
printf("\t\t\t*** 3-查詢學生學分 ***\n");
printf("\t\t\t*** 4-修改學生學分 ***\n");
printf("\t\t\t*** 5-刪除學生學分 ***\n");
printf("\t\t\t*** 6-統計學生學分 ***\n");
printf("\t\t\t*** 0-退出 ***\n");
printf("\t\t\t****************************\n");
}
void input()
{ do
{ printf("請輸入學生信息:學號 姓名 班級 基礎課 專業課 選修課 人文課 實驗課\n");
scanf("%s%s%s%d%d%d%d%d",st[n].num,st[n].name,st[n].class,&st[n].jichu,&st[n].zhuanye,&st[n].xuanxiu,&st[n].renwen,&st[n].shiyan);
n++;
printf("是否繼續輸入?(n-退出,任意鍵繼續):");
}while(getche()!='n');
}
void print()
{ int i;
printf("\n序號\t學號\t 姓名\t班級\t基礎課\t專業課\t選修課\t人文課\t實驗課\n");
for(i=0;i<n;i++)
printf("%2d %7s %7s %5s %4d\t%4d\t%4d\t%4d\t%4d\n",i+1,st[i].num,st[i].name,st[i].class,st[i].jichu,st[i].zhuanye,st[i].xuanxiu,st[i].renwen,st[i].shiyan);
getch();
}
void menu1()
{ clrscr();
printf("\t\t\t*****************************\n");
printf("\t\t\t***********查詢模塊**********\n");
printf("\t\t\t*** 1-按學號查詢 ***\n");
printf("\t\t\t*** 2-按姓名查詢 ***\n");
printf("\t\t\t*** 3-按班級查詢 ***\n");
printf("\t\t\t*** 0-退出 ***\n");
printf("\t\t\t*****************************\n");
}
void query1()
{ char sn[11];
int i;
printf("請輸入要查詢的學號:");
scanf("%s",sn);
for(i=0;i<n;i++)
if(strcmp(sn,st[i].num)==0)
{printf("\n序號\t學號\t 姓名\t班級\t基礎課\t專業課\t選修課\t人文課\t實驗課\n");
printf("%2d %7s %7s %5s %4d\t%4d\t%4d\t%4d\t%4d\n",i+1,st[i].num,st[i].name,st[i].class,st[i].jichu,st[i].zhuanye,st[i].xuanxiu,st[i].renwen,st[i].shiyan);
printf("\按任意鍵繼續");
break;
}
else printf("\n對不起!沒有該學號,任意鍵繼續");
getch();
}
void query2()
{ char sn[7];
int i;
printf("請輸入要查詢的姓名:");
scanf("%s",sn);
for(i=0;i<n;i++)
if(strcmp(sn,st[i].name)==0)
{printf("\n序號\t學號\t 姓名\t班級\t基礎課\t專業課\t選修課\t人文課\t實驗課\n");
printf("%2d %7s %7s %5s %4d\t%4d\t%4d\t%4d\t%4d\n",i+1,st[i].num,st[i].name,st[i].class,st[i].jichu,st[i].zhuanye,st[i].xuanxiu,st[i].renwen,st[i].shiyan);
printf("\按任意鍵繼續");
break;
}else printf("\n對不起!沒有該姓名,任意鍵繼續");
getch();
}
void query3()
{ char sn[10];
int i;
printf("請輸入要查詢的班級:");
scanf("%s",sn);
for(i=0;i<n;i++)
if(strcmp(sn,st[i].class)==0)
{printf("\n序號\t學號\t 姓名\t班級\t基礎課\t專業課\t選修課\t人文課\t實驗課\n");
printf("%2d %7s %7s %5s %4d\t%4d\t%4d\t%4d\t%4d\n",i+1,st[i].num,st[i].name,st[i].class,st[i].jichu,st[i].zhuanye,st[i].xuanxiu,st[i].renwen,st[i].shiyan);
printf("\按任意鍵繼續");
break;
}
else printf("\n對不起!沒有該班,任意鍵繼續");
getch();
}
void query()
{ int s;
do{
menu1();
printf("\n\t\t\t\t 請選擇:");
scanf("%d",&s);
switch(s)
{ case 0:break;
case 1:query1();break;
case 2:query2();break;
case 3:query3();break;
default:printf("選擇無效!");
}
}while(s!=0);
getch();
}
void menu2()
{ clrscr();
printf("\t\t\t*****************************\n");
printf("\t\t\t***********修改模塊**********\n");
printf("\t\t\t*** 1-按學號修改 ***\n");
printf("\t\t\t*** 2-按姓名修改 ***\n");
printf("\t\t\t*** 3-按班級修改 ***\n");
printf("\t\t\t*** 0-退出 ***\n");
printf("\t\t\t*****************************\n");
}
void modi1()
{ char sn[11];
int i;
printf("請輸入要修改學分學生的學號:");
scanf("%s",sn);
for(i=0;i<n;i++)
if(strcmp(sn,st[i].num)==0)
{printf("\n序號\t學號\t 姓名\t班級\t基礎課\t專業課\t選修課\t人文課\t實驗課\n");
printf("%2d %7s %7s %5s %4d\t%4d\t%4d\t%4d\t%4d\n",i+1,st[i].num,st[i].name,st[i].class,st[i].jichu,st[i].zhuanye,st[i].xuanxiu,st[i].renwen,st[i].shiyan);
{printf("請輸入學生學分信息:學號 姓名 班級 基礎課 專業課 選修課 人文課 實驗課\n");
scanf("%s%s%s%d%d%d%d%d",st[i].num,st[i].name,st[i].class,&st[i].jichu,&st[i].zhuanye,&st[i].xuanxiu,&st[i].renwen,&st[i].shiyan);
printf("是否繼續輸入?(n-退出,任意鍵繼續):");
}while(getche()!='n');
break;
}
getch();
}
void modi2()
{ char sn[7];
int i;
printf("請輸入要修改學分學生的姓名:");
scanf("%s",sn);
for(i=0;i<n;i++)
if(strcmp(sn,st[i].name)==0)
{printf("\n序號\t學號\t 姓名\t班級\t基礎課\t專業課\t選修課\t人文課\t實驗課\n");
printf("%2d %7s %7s %5s %4d\t%4d\t%4d\t%4d\t%4d\n",i+1,st[i].num,st[i].name,st[i].class,st[i].jichu,st[i].zhuanye,st[i].xuanxiu,st[i].renwen,st[i].shiyan);
{printf("請輸入學生學分信息:學號 姓名 班級 基礎課 專業課 選修課 人文課 實驗課\n");
scanf("%s%s%s%d%d%d%d%d",st[i].num,st[i].name,st[i].class,&st[i].jichu,&st[i].zhuanye,&st[i].xuanxiu,&st[i].renwen,&st[i].shiyan);
printf("是否繼續輸入?(n-退出,任意鍵繼續):");
}while(getche()!='n');
break;
}
getch();
}
void modi3()
{ char sn[10];
int i;
printf("請輸入要修改學分學生的班級:");
scanf("%s",sn);
for(i=0;i<n;i++)
if(strcmp(sn,st[i].class)==0)
{printf("\n序號\t學號\t 姓名\t班級\t基礎課\t專業課\t選修課\t人文課\t實驗課\n");
printf("%2d %7s %7s %5s %4d\t%4d\t%4d\t%4d\t%4d\n",i+1,st[i].num,st[i].name,st[i].class,st[i].jichu,st[i].zhuanye,st[i].xuanxiu,st[i].renwen,st[i].shiyan);
{printf("請輸入學生學分信息:學號 姓名 班級 基礎課 專業課 選修課 人文課 實驗課\n");
scanf("%s%s%s%d%d%d%d%d",st[i].num,st[i].name,st[i].class,&st[i].jichu,&st[i].zhuanye,&st[i].xuanxiu,&st[i].renwen,&st[i].shiyan);
printf("是否繼續輸入?(n-退出,任意鍵繼續):");
} while(getche()!='n');
break;
}
getch();
}
void modi()
{ int s;
do{
menu2();
printf("\n\t\t\t\t 請選擇:");
scanf("%d",&s);
switch(s)
{ case 0:break;
case 1:modi1();break;
case 2:modi2();break;
case 3:modi3();break;
default:printf("選擇無效!");
}
}while(s!=0);
getch();
}
void menu3()
{ clrscr();
printf("\t\t\t*****************************\n");
printf("\t\t\t***********刪除模塊**********\n");
printf("\t\t\t*** 1-按學號刪除 ***\n");
printf("\t\t\t*** 2-按姓名刪除 ***\n");
printf("\t\t\t*** 3-按班級刪除 ***\n");
printf("\t\t\t*** 0-退出 ***\n");
printf("\t\t\t*****************************\n");
}
void del1()
{ char sn[11];
int i,j;
printf("請輸入要刪除學分學生的學號:");
scanf("%s",sn);
for(i=0;i<n;i++)
if(strcmp(sn,st[i].num)==0)
{printf("\n序號\t學號\t 姓名\t班級\t基礎課\t專業課\t選修課\t人文課\t實驗課\n");
printf("%2d %7s %7s %5s %4d\t%4d\t%4d\t%4d\t%4d\n",i+1,st[i].num,st[i].name,st[i].class,st[i].jichu,st[i].zhuanye,st[i].xuanxiu,st[i].renwen,st[i].shiyan);
printf("\n是否刪除(任意鍵確認,n\取消)");
if(getche()!='n');
{if(i!=n-1);
for(j=i;j<n-1;j++)
st[j]=st[j+1];
n--;
printf("\n該記錄已刪除");
getch();
break ;
}
}
else printf("\n對不起!沒有該學號,任意鍵繼續");
}
void del2()
{ char sn[7];
int i,j;
printf("請輸入要刪除學分學生的姓名:");
scanf("%s",sn);
for(i=0;i<n;i++)
if(strcmp(sn,st[i].name)==0)
{printf("\n序號\t學號\t 姓名\t班級\t基礎課\t專業課\t選修課\t人文課\t實驗課\n");
printf("%2d %7s %7s %5s %4d\t%4d\t%4d\t%4d\t%4d\n",i+1,st[i].num,st[i].name,st[i].class,st[i].jichu,st[i].zhuanye,st[i].xuanxiu,st[i].renwen,st[i].shiyan);
printf("\n是否刪除(任意鍵確認,n\取消)");
if(getche()!='n');
{if(i!=n-1);
for(j=i;j<n-1;j++)
st[j]=st[j+1];
n--;
printf("\n該記錄已刪除");
getch();
break ;
}
}
else printf("\n對不起!沒有該學號,任意鍵繼續");
}
void del3()
{ char sn[10];
int i,j;
printf("請輸入要刪除學分學生的班級:");
scanf("%s",sn);
for(i=0;i<n;i++)
if(strcmp(sn,st[i].class)==0)
{printf("\n序號\t學號\t 姓名\t班級\t基礎課\t專業課\t選修課\t人文課\t實驗課\n");
printf("%2d %7s %7s %5s %4d\t%4d\t%4d\t%4d\t%4d\n",i+1,st[i].num,st[i].name,st[i].class,st[i].jichu,st[i].zhuanye,st[i].xuanxiu,st[i].renwen,st[i].shiyan);
printf("\n是否刪除(任意鍵確認,n\取消)");
if(getche()!='n');
{if(i!=n-1);
for(j=i;j<n-1;j++)
st[j]=st[j+1];
n--;
printf("\n該記錄已刪除");
getch();
break ;
}
}
else printf("\n對不起!沒有該學號,任意鍵繼續");
}
void del()
{ int s;
do{
menu3();
printf("\n\t\t\t\t 請選擇:");
scanf("%d",&s);
switch(s)
{ case 0:break;
case 1:del1();break;
case 2:del2();break;
case 3:del3();break;
default:printf("選擇無效!");
}
}while(s!=0);
getch();
}
void menu4()
{ clrscr();
printf("\t\t\t*****************************\n");
printf("\t\t\t***********統計模塊**********\n");
printf("\t\t\t*** 1- 可升學的學生 ***\n");
printf("\t\t\t*** 2-需補考基礎課的 ***\n");
printf("\t\t\t*** 3-需補考專業課的 ***\n");
printf("\t\t\t*** 4-需補考選修課的 ***\n");
printf("\t\t\t*** 5-需補考人文課的 ***\n");
printf("\t\t\t*** 6-需補考實驗課的 ***\n");
printf("\t\t\t*** 0-退出 ***\n");
printf("\t\t\t*****************************\n");
}
void count1()
{ int i;
printf("\n序號\t學號\t 姓名\t班級\t基礎課\t專業課\t選修課\t人文課\t實驗課\n");
for(i=0;i<n;i++)
if(st[i].jichu>=60&st[i].zhuanye>=60&st[i].xuanxiu>=60&st[i].renwen>=60&st[i].shiyan>=60)
printf("%2d %7s %7s %5s %4d\t%4d\t%4d\t%4d\t%4d\n",i+1,st[i].num,st[i].name,st[i].class,st[i].jichu,st[i].zhuanye,st[i].xuanxiu,st[i].renwen,st[i].shiyan);
getch();
}
void count2()
{ int i;
printf("\n序號\t學號\t 姓名\t班級\t基礎課\t專業課\t選修課\t人文課\t實驗課\n");
for(i=0;i<n;i++)
if(st[i].jichu<60&st[i].zhuanye>=60&st[i].xuanxiu>=60&st[i].renwen>=60&st[i].shiyan>=60)
printf("%2d %7s %7s %5s %4d\t%4d\t%4d\t%4d\t%4d\n",i+1,st[i].num,st[i].name,st[i].class,st[i].jichu,st[i].zhuanye,st[i].xuanxiu,st[i].renwen,st[i].shiyan);
getch();
}void count3()
{ int i;
printf("\n序號\t學號\t 姓名\t班級\t基礎課\t專業課\t選修課\t人文課\t實驗課\n");
for(i=0;i<n;i++)
if(st[i].jichu>=60&st[i].zhuanye<60&st[i].xuanxiu>=60&st[i].renwen>=60&st[i].shiyan>=60)
printf("%2d %7s %7s %5s %4d\t%4d\t%4d\t%4d\t%4d\n",i+1,st[i].num,st[i].name,st[i].class,st[i].jichu,st[i].zhuanye,st[i].xuanxiu,st[i].renwen,st[i].shiyan);
getch();
}
void count4()
{ int i;
printf("\n序號\t學號\t 姓名\t班級\t基礎課\t專業課\t選修課\t人文課\t實驗課\n");
for(i=0;i<n;i++)
if(st[i].jichu>=60&st[i].zhuanye>=60&st[i].xuanxiu<60&st[i].renwen>=60&st[i].shiyan>=60)
printf("%2d %7s %7s %5s %4d\t%4d\t%4d\t%4d\t%4d\n",i+1,st[i].num,st[i].name,st[i].class,st[i].jichu,st[i].zhuanye,st[i].xuanxiu,st[i].renwen,st[i].shiyan);
getch();
}
void count5()
{ int i;
printf("\n序號\t學號\t 姓名\t班級\t基礎課\t專業課\t選修課\t人文課\t實驗課\n");
for(i=0;i<n;i++)
if(st[i].jichu>=60&st[i].zhuanye>=60&st[i].xuanxiu>=60&st[i].renwen<60&st[i].shiyan>=60)
printf("%2d %7s %7s %5s %4d\t%4d\t%4d\t%4d\t%4d\n",i+1,st[i].num,st[i].name,st[i].class,st[i].jichu,st[i].zhuanye,st[i].xuanxiu,st[i].renwen,st[i].shiyan);
getch();
}
void count6()
{ int i;
printf("\n序號\t學號\t 姓名\t班級\t基礎課\t專業課\t選修課\t人文課\t實驗課\n");
for(i=0;i<n;i++)
if(st[i].jichu>=60&st[i].zhuanye>=60&st[i].xuanxiu>=60&st[i].renwen>=60&st[i].shiyan<60)
printf("%2d %7s %7s %5s %4d\t%4d\t%4d\t%4d\t%4d\n",i+1,st[i].num,st[i].name,st[i].class,st[i].jichu,st[i].zhuanye,st[i].xuanxiu,st[i].renwen,st[i].shiyan);
getch();
}
void count()
{ int s;
do{
menu4();
printf("\n\t\t\t\t 請選擇:");
scanf("%d",&s);
switch(s)
{ case 0:break;
case 1:count1();break;
case 2:count2();break;
case 3:count3();break;
case 4:count4();break;
case 5:count5();break;
case 6:count6();break;
default:printf("選擇無效!");
}
}while(s!=0);
getch();
}