當前位置:首頁 » 編程語言 » 基於c語言的教務系統簡單嗎
擴展閱讀
webinf下怎麼引入js 2023-08-31 21:54:13
堡壘機怎麼打開web 2023-08-31 21:54:11

基於c語言的教務系統簡單嗎

發布時間: 2022-05-22 20:53:47

c語言做的學生管理系統,要簡單的。


#include"stdio.h"
#defineSIZE5

structstu
{
charname[10];
intno;
intage;
charadd[10];
}stu[SIZE];

voidreaddat();
voidwritedat();
voidchange();

main()
{
chark;

printf("歡迎進入學生信息管理系統 ");
printf(" 1.學生信息輸入系統");
printf("2.學生信息查詢系統 ");
printf("3.學生信息修改系統 ");
began:
printf(" 請輸入選項:");
scanf("%d",&k);
switch(k)
{
case1:writedat();break;

case2:readdat();break;

case3:change();break;

default:gotobegan;
}
gotobegan;
}

voidwritedat()
{
FILE*fp;
chari;

printf(" 請輸入學生的姓名、學號、年齡和地址: ");
for(i=0;i<SIZE;i++)
{
printf("輸入%d號學生信息:",i+1);
scanf("%s%d%d%s",stu[i].name,&stu[i].no,&stu[i].age,stu[i].add);
}

if((fp=fopen("E:\a.dat","wb"))==NULL)
{
printf("OpenError ");
return;
}
for(i=0;i<SIZE;i++)
{
if(fwrite(&stu[i],sizeof(structstu),1,fp)!=1)
printf("writeerror ");
}
fclose(fp);
}

voidreaddat()
{
FILE*fp;
inti,k,kk;

jixu:
printf("查詢全部請輸入0,查詢單個請輸入1:");
scanf("%d",&k);

if((fp=fopen("E:\a.dat","rb"))==NULL)
{
printf("ReadError ");
return;
}
if(k==0)
{
printf("編號姓名學號年齡地址 ");
for(i=0;i<SIZE;i++)
{
if(fread(&stu[i],sizeof(structstu),1,fp)!=1)
{
if(!feof(fp))
printf("writeerror ");
return;
}
printf("%-5d%-8s%-8d%-5d%s ",i+1,stu[i].name,stu[i].no,stu[i].age,stu[i].add);
}
}
elseif(k==1)
{
printf("請輸入學生的編號:");
scanf("%d",&kk);
printf("編號姓名學號年齡地址 ");
if(fread(&stu[kk-1],sizeof(structstu),1,fp)!=1)
{
if(!feof(fp))
printf("writeerror ");
return;
}
printf("%-5d%-8s%-8d%-5d%s ",kk,stu[kk-1].name,stu[kk-1].no,stu[kk-1].age,stu[kk-1].add);
}
else
{
printf("輸入錯誤!");
gotojixu;
}
fclose(fp);
}

voidchange()
{
FILE*fp;
chari,kk;

while(1)
{
printf("請輸入修改信息學生的編號(0退出):");
scanf("%d",&kk);
if(kk==0)
return;

printf("編號姓名學號年齡地址 ");
if((fp=fopen("E:\a.dat","rb"))==NULL)
{
printf("ReadError ");
return;
}
for(i=0;i<SIZE;i++)
if(fread(&stu[i],sizeof(structstu),1,fp)!=1)
{
if(!feof(fp))
printf("writeerror ");
return;
}
printf("%-5d%-8s%-8d%-5d%s ",kk,stu[kk-1].name,stu[kk-1].no,stu[kk-1].age,stu[kk-1].add);

printf("請輸入學生的姓名、學號、年齡和地址: ");
scanf("%s%d%d%s",stu[kk-1].name,&stu[kk-1].no,&stu[kk-1].age,stu[kk-1].add);
if((fp=fopen("E:\a.dat","wb"))==NULL)
{
printf("OpenError ");
return;
}
for(i=0;i<SIZE;i++)
{
if(fwrite(&stu[i],sizeof(structstu),1,fp)!=1)
printf("writeerror ");
}

fclose(fp);
}
}

㈡ C語言編程--教務信息管理系統

你給這么點分,誰願意為你做題!大哥現在是經濟是帶什麼都講價值的,一般程序員每天至少三千多,一個小時都二三十,誰還願意花時間來要你這么點的分!

㈢ 求C語言課程設計(教務信息管理系統)

/*-------------1-------------*/
#include<bios.h>
#include<dos.h> /*頭文件*/
#include<conio.h>
#include<ctype.h>
#include<process.h>
#include<stdlib.h>
#include<stdio.h>
#include<string.h>

#define NULL 0
#define ESC 0x001b /* 退出 */
#define F1 0x3b00 /* 查看幫助信息,調用HelpMassage()函數 */
#define F2 0x3c00 /*輸入學生成績*/
#define F3 0x3d00 /*按學號查找*/
#define F4 0x3e00 /*按姓名查找*/
#define F5 0x3f00 /*列出所有學生成績*/
#define F6 0x4000 /*統計*/

struct stuType /*定義結構體變數*/
{
char NO[11]; /*學號長度為10*/
char XM[10];
char AGE[2]; /*年齡長度為2*/
float CJ[4]; /*包含4門成績*/
};

/*-------------2-------------*/
int JY_NO(char *stu_num,FILE *fp) /*檢驗學號的正確性*/
{ struct stuType stud;
int NO;
char *p=stu_num;
if(strcmp(stu_num,"#")==0) return 1; /*若輸入"#"返回真值,不再循環輸入*/
while(*p!='\0') /*學號必須是數字,否則返回重新輸入*/
{ NO=(int)*p;
if(NO<48||NO>57)
{ puts("\t\tUndefined SN!Please input again!\n");/*非法學號!請重新輸入!*/
return 0;
}
else p++; /*指針加1*/
}
if(strlen(stu_num)!=10) /*若學號長度不為10,則返回重新輸入*/
{ puts("\t\tLength of SN Error!\n");/*學號長度不對*/
return 0;
}
if(getchar()!='\n') /*若學號後面的字元不是回車符,則學號長度大於10*/
{ printf("\t\tThe length of SN should more than 10!Please input again!\n");/*學號長度大於10個,請重新輸入*/
do{}while(getchar()!='\n'); /*用getchar接收多餘的字元*/
return 0;
}

else
{
rewind(fp); /*使文件指針指向頭*/
while(!feof(fp)) /*若文件指針未到結尾,就繼續執行下面的循環,feof遇到文件結束符返回非零值,否則返回0*/
{ fread(&stud,sizeof(struct stuType),1,fp); /*讀取一定長度的數據*/
if(strcmp(stu_num,stud.NO)==0) /*學號的唯一性*/
{ printf("\t\t Repeat SN,Please input again!\n");/*學號重復!請重新輸入*/
printf("\t\tThe Record of this student:\n");/*該學生成績如下*/
printf("\t\tChinese:%.1f\n",stud.CJ[0]);/*語文*/
printf("\t\tMath:%.1f\n",stud.CJ[1]);/*數學*/
printf("\t\tEnglish:%.1f\n",stud.CJ[2]);/*英語*/
printf("\t\tTotal:%.1f\n",stud.CJ[3]);/*總評*/
return 0;
}
}
}
return 1;

}
/*-------------3-------------*/
int JY_NO2(char *stu_num) /*檢驗學號*/
{ int NO;
char *p=stu_num;
if(strcmp(stu_num,"#")==0)return 1; /*若輸入「#」,則返回真值結束*/
if(strlen(stu_num)!=10) /*學號長度不為10*/
{ puts("\t\tLength of SN Error!\n");/*學號長度不對*/
return 0;
}
while(*p!='\0') /*學號必須用數字,若包含有字母,或其它字元則返回假值重新輸入*/
{ NO=(int)*p;
if(NO<48||NO>57)
{ puts("\t\tUndefined SN!Please input again!\n");/*非法學號!請重新輸入*/
return 0;
}
else p++; /*指針加1*/
}
if(getchar()!='\n') /*檢驗學號長度是否大於10,並把多餘的字元去掉*/
{ printf("\t\tThe length of SN should more than 10!Please input again!\n");/*學號長度大於10個,請重新輸入*/
do{}while(getchar()!='\n');
return 0;
}
return 1;
}

/*-------------4-------------*/
int JY_XM(char *stu_XM) /*檢驗姓名*/
{ int PD;
char *p;
p=stu_XM;
while(*p!='\0') /*姓名只能用英文*/
{
PD=(int)*p;
if(PD<0)
{ puts("\t\tName should use English, Please input again!\n");/*姓名只能用英文請重新輸入*/
return 0;
}
else p++; /*使指針加1,指向下一漢字*/
}
if(getchar()!='\n') /*姓名長度不得大於5個*/
{ printf("\t\tThe length of Name is more than 5, Please input again!\n");/*姓名長度大於5個請重新輸入*/
do{}while(getchar()!='\n');
return 0;
}
return 1; /*字元串全為漢字返回真*/

}

/*-------------5-------------*/
int JY_AGE(float stu_AGE) /*年齡只能在0~100之間*/
{
if(stu_AGE<0||stu_AGE>100)
{ printf("\t\tInput Error! Record should between 0~100!\n");/*輸入錯誤,成績只能在0~100之間*/
return 0;
}
return 1;
}

/*-------------6-------------*/
int JY_CJ(float stu_CJ) /*學生成績只能在0~100之間*/
{
if(stu_CJ<0||stu_CJ>100)
{ printf("\t\tInput Error! Record should between 0~100!\n");/*輸入錯誤,成績只能在0~100之間*/
return 0;
}
return 1;
}

/*-------------7-------------*/
void CreatFile() /*輸入文件*/
{ FILE *fp;
struct stuType stu,stu0={"","",}; /*對stu0xianfu*/
fp=fopen("stu.dat","wb+"); /*打開或創建一個二進制文件,打開時將原來的內容刪除*/
if(fp==NULL)
{ printf("\t\tFile opens Error!\n\t\t\tPress Anykey back...");/*文件打開失敗,按任意鍵返回*/
getch();
return;
}
else
{ while(1)
{ stu=stu0;
do{ printf("\n\t\tPlease input SN:"); /*輸入學號並檢驗其正確性*/
scanf("%10s",stu.NO);
}while(!JY_NO(stu.NO,fp));
if(strcmp(stu.NO,"#")==0)break;
do{ printf("\n\t\tPlease input Name:"); /*輸入姓名並檢驗其正確性*/
scanf("%10s",stu.XM);
}while(!JY_XM(stu.XM));
do{ printf("\n\t\tPlease input age:"); /*輸入年齡績並檢驗其正確性*/
scanf("%f",&stu.AGE);
}while(!JY_AGE(stu.AGE[0]));
do{ printf("\n\t\tPlease input record of Chinese:"); /*輸入成績並檢驗其正確性*/
scanf("%f",&stu.CJ[0]);
}while(!JY_CJ(stu.CJ[0]));
do{ printf("\n\t\tPlease input record of Math:"); /*同上*/
scanf("%f",&stu.CJ[1]);
}while(!JY_CJ(stu.CJ[1]));
do{ printf("\n\t\tPlease input record of English:");
scanf("%f",&stu.CJ[2]);
}while(!JY_CJ(stu.CJ[2]));
do{ printf("\n\t\tPlease input record of Total:");
scanf("%f",&stu.CJ[3]);
}while(!JY_CJ(stu.CJ[3]));
fwrite(&stu,sizeof(struct stuType),1,fp); /*寫文件*/
}

}
fclose(fp); /*關閉文件*/

}

/*-------------8-------------*/
void Search_Xuehao() /*按學號查詢*/
{ FILE *fp;
int flag;
struct stuType stu,stud;
fp=fopen("stu.dat","rb");
if(fp==NULL) /*若文件打不開則輸出下面的信息*/
{ printf("\t\tFile opens Error!\n\t\t\tPress Anykey back...");
getch();
return;
}
else
{ do{ puts("\n\t\tPress\"#\" or search");
do{ printf("\t\tPlease input the SN what you want:");
scanf("%10s",stu.NO);
}while(!JY_NO2(stu.NO));
if(strcmp(stu.NO,"#")==0)break; /*若輸入「#」則結束循環*/
flag=0;
rewind(fp);
while(fread(&stud,sizeof(struct stuType),1,fp)) /*檢查文件指針結束*/
{ if(strcmp(stu.NO,stud.NO)==0) /*比較學號*/
{ puts("\t\tThe Record of this student:");
printf("\t\tSN:%s\n",stud.NO);
printf("\t\tName:%s\n",stud.XM);
printf("\t\tAGE:%.1f\n",stud.AGE[0]);
printf("\t\tChinese:%.1f\n",stud.CJ[0]);
printf("\t\tMath:%.1f\n",stud.CJ[1]);
printf("\t\tEnglish:%.1f\n",stud.CJ[2]);
printf("\t\tTotal:%.1f\n",stud.CJ[3]);
flag=1; /*記錄學號是否查到*/
}
}
if(flag==0)puts("\t\tUndefined SN");
}while(strcmp(stu.NO,"#")!=0);

}
fclose(fp); /*關閉文件*/

}

/*-------------9-------------*/
void Search_Xingming() /*按姓名查找*/
{ FILE *fp;
int flag=0;
struct stuType stu,stud;
fp=fopen("stu.dat","rb");
if(fp==NULL)
{ printf("\t\tFile opens Error!\n\t\tPress Anykey back...");
getch();
return;
}
else
{ do{
do{ printf("\t\tPlease input the Name of the Student what you want:");
scanf("%10s",stu.XM);
}while(!JY_XM(stu.XM));
rewind(fp); /*文件指針指向頭*/
while(fread(&stud,sizeof(struct stuType),1,fp))
{ if(strcmp(stu.XM,stud.XM)==0) /*比較姓名是否相同*/
{ puts("\t\tThe name of the Student is:");
printf("\t\tSN:%s\n",stud.NO);
printf("\t\tName:%s\n",stud.XM);
printf("\t\tAGE:%.1f\n",stud.AGE[0]);
printf("\t\tChinese:%.1f\n",stud.CJ[0]);
printf("\t\tMath:%.1f\n",stud.CJ[1]);
printf("\t\tEnglish:%.1f\n",stud.CJ[2]);
printf("\t\tTotal:%.1f\n",stud.CJ[3]);
flag=1; /*記錄姓名是否被查到*/
}
}
if(flag==0)puts("\n\t\tUndefined Name!");
puts("\t\tContinue?(y--yes,Else key back)?");
}while(getch()=='y');
}
fclose(fp);
/* puts("\t\tPress Anykey to continue...");*/
/* getch();*/

}

/*-------------10-------------*/
int ListFile(void) /*輸出文件,列出所有學生成績*/
{ FILE *fp;
int REC=0; /*記錄學生人數*/
struct stuType stu;
fp=fopen("stu.dat","rb");
if(fp==NULL)
{ printf("\t\tFile opens Error!\n\t\tPress Anykey back...");
getch();
return 1;
}
else{ printf("\t\tRecords of the Students:\n");
printf("\t\tSN\t\tName\tChinese\tMath\tEnglish\tTotal\n");
rewind(fp);
while(fread(&stu,sizeof(struct stuType),1,fp))
{ /*每讀取一個長度的數據就輸出*/
printf("\t\t%s",stu.NO);
printf("\t%s",stu.XM);
printf("\t%.1f",stu.AGE);
printf("\t%.1f",stu.CJ[0]);
printf("\t%.1f",stu.CJ[1]);
printf("\t%.1f",stu.CJ[2]);
printf("\t%.1f",stu.CJ[3]);
printf("\n");
REC++;
if(REC%20==0) /*20個學生成績,停一下*/
{ printf("\t\tPress Anykey to continue...\n");
getch();
}
}
}
fclose(fp); /*關閉文件*/
printf("\t\tContinue...");
getch();

}

/*-------------11-------------*/
void Statistics() /*統計及格和優秀人數*/
{ FILE *fp;
int REC=0,unpass[4]={0},good[4]={0}; /*REC--記錄個數,即人數,unpass--重修人數,good--優秀人數*/
float highest[4]={0},score[4]={0}; /*highest--最高分,score--總分*/

struct stuType stu;
fp=fopen("stu.dat","rb");
if(fp==NULL)
{ printf("\t\tFile opens Error!\n\t\tPress Anykey back...");
getch();
return;
}
else { rewind(fp);
while(fread(&stu,sizeof(struct stuType),1,fp))
{ REC++;
score[0]=score[0]+stu.CJ[0]; /*語文*/
if(stu.CJ[0]<=60)unpass[0]++;
if(stu.CJ[0]>=80)good[0]++;
if(highest[0]<stu.CJ[0])highest[0]=stu.CJ[0];
score[1]=score[1]+stu.CJ[1]; /*數學*/
if(stu.CJ[1]<=60)unpass[1]++;
if(stu.CJ[1]>=80)good[1]++;
if(highest[1]<stu.CJ[1])highest[1]=stu.CJ[1];
score[2]=score[2]+stu.CJ[2]; /*英語*/
if(stu.CJ[2]<=60)unpass[2]++;
if(stu.CJ[2]>=80)good[2]++;
if(highest[2]<stu.CJ[2])highest[2]=stu.CJ[2];
score[3]=score[3]+stu.CJ[3]; /*總評*/
if(stu.CJ[3]<=60)unpass[3]++;
if(stu.CJ[3]<=80)good[3]++;
if(highest[3]<stu.CJ[3])highest[3]=stu.CJ[3];
}
if(REC==0) /*可以防止記錄為0是REC作除數而造成的錯誤*/
{ printf("\t\tYou did't input the Name!Press Anykey back...");
getch();
return;
}
else{
printf("\t Chinese\t Math\t English\tTotal\n"); /*輸出統計信息*/
printf("\tAverage: %.1f\t %.1f\t %.1f\t\t%.1f\n",score[0]/REC,score[1]/REC,score[2]/REC,score[3]/REC);
printf("\tTop record: %.1f\t %.1f\t %.1f\t\t%.1f\n",highest[0],highest[1],highest[2],highest[3]);
printf("\tNumber of good students: %d\t\t %d\t %d\t\t %d\n",good[0],good[1],good[2],good[3]);
printf("\tNumber of unpassed students:%d\t\t %d\t %d\t\t %d\n",unpass[0],unpass[1],unpass[2],unpass[3]);
}
}
fclose(fp);
printf("\n\t\t\tPress Anykey to continue...");
getch();

}

/*-------------12-------------*/
void HelpMessage()
{ clrscr();
printf("\n\n\n\n\n chi xi tong shi lao shi suo bu zuoye bian ercheng,gai xitong juyou cunchu xuesheng shuju,an xuehao,xingming chaxun,liechu xuesheng chengji he tongjigongneng.\n \n shiyongfangfa:xitong shulu shuju hou,jiangzai dangqian muluzhong jianli yige mingwei stu.dat wenjian,yongyubaocun shulu de shuju.xuehao shulu neng yong shuzi shulu qie xuehao neng shi10wei.xingming shulu fuhe zhongguoren de xingming,neng yong zhongwen pinying,qie zuichangwei5 ge han.\n chi chenxu zai Turbo C2.0xia yunxing tongguo \n\n ");
getch();
}

/*-------------13-------------*/
int GetKey(void) /*此函數返回一個按鍵的數值*/
{ int key;
key=bioskey(0); /*bioskey為調用BIOS鍵盤介面*/
if(key<<8) /*位移*/
{
key=key&0x00ff;

}
return key; /*返回按鍵*/
}

/*-------------14-------------*/
void main()
{ int key;
struct date d; /*定義時間結構體*/
getdate(&d); /*讀取系統日期並把它放到結構體d中*/
clrscr(); /*清除屏幕*/
printf("\n\n\n\n\n");
printf("\t ========================================================\n"); /*版本信息*/
printf("\n");
printf("\t\t The System of Students Records Management 1.0 \n");
printf("\n");
printf("\n");
printf("\t\t Builder: XG042-WZM YS HYF WQ \n");
printf("\t\t Teacher:Song Zheyuan\n");
printf("\t\t Time:2005\\7\\5 \n");
printf("\n");
printf("\t ========================================================\n");
printf("\t\t\tPress Anykey to continue...");
/*while(!kbhit());*/
getch(); /*從鍵盤讀取一個字元,但不顯示於屏幕*/
system("cls"); /*調用DOS的清屏函數,TC中可用clrscr代替*/
while(1) /*主菜單*/
{
printf("\n\n\n\n\n");
printf("\t **************************************************\n");
printf("\t **\t **\n");
printf("\t **\tF1 --Help **\n");
printf("\t **\t **\n");
printf("\t **\tF2 --Data Input & Save **\n");
printf("\t **\t **\n");
printf("\t **\tF3 --Search by SN **\n");
printf("\t **\t **\n");
printf("\t **\tF4 --Search by Name **\n");
printf("\t **\t **\n");
printf("\t **\tF5 --Contents Input **\n");
printf("\t **\t **\n");
printf("\t **\tF6 --Count Students Number(Passed&Good) **\n");
printf("\t **\t **\n");
printf("\t **\tESC--Quit the System **\n");
printf("\t **\t **\n");
printf("\t **************************************************\n");
printf("\n\t Please select...\t\t%d\\%d\\%d\n\n",d.da_year,d.da_mon,d.da_day); /*提示信息,並顯示當前系統日期*/
key=GetKey(); /*調用自定義函數,讀取一個鍵*/
switch(key)
{
case F1: HelpMessage(); break;
case F2: CreatFile(); break;

case F3: Search_Xuehao(); break;
case F4: Search_Xingming();break;
case F5: ListFile(); break;
case F6: Statistics(); break;
case ESC:exit(1); break;
/*default: puts("\t\t\tWrong SN input!");
printf("\t\t\tPress Anykey back...");
getch();*/
}
clrscr(); /*每執行完一項功能後,自動清屏*/
}

}

㈣ 怎樣用C語言編寫教務管理系統

我去年做的
#include<time.h>
#include<stdio.h>
#include<conio.h>
#include <stdlib.h>
#define MAX 50
void input();
void sort();
void display();
void insert();
void del();
void average();
int now_no=0;
struct student
{
int no;
char name[20];
char sex[4];
float score1;
float score2;
float score3;
float sort;
float ave;
float sum;
};
struct student stu[MAX],*p;
main()//主函數
{
char as;
start: printf("\t\t\t歡迎使用學生成績管理系統\n\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選擇功能選項:");
as=getch();
switch(as)
{
case '1':
system("cls");
input();
break;
case '2':
system("cls");
display();
break;
case '3':
system("cls");
sort();
break;
case '4':
system("cls");
insert();
break;
case '5':
system("cls");
del();
break;
case '6':
system("exit");
exit(0);
default:
system("cls");
goto start;
}
}while(1);
//至此功能選擇結束
}
void input()//原始數據錄入模塊
{
int i=0;
char ch;
do
{
printf("\t\t\t\t1.錄入學員信息\n輸入第%d個學員的信息\n",i+1);
printf("\n輸入學生編號:");
scanf("%d",&stu[i].no);
fflush(stdin);
printf("\n輸入學員姓名:");
fflush(stdin);
gets(stu[i].name);
printf("\n輸入學員性別:");
fflush(stdin);
gets(stu[i].sex);
printf("\n輸入學員成績:");
fflush(stdin);
scanf("%f",&stu[i].score1);
printf("\n輸入學員成績:");
fflush(stdin);
scanf("%f",&stu[i].score2);
printf("\n輸入學員成績:");
fflush(stdin);
scanf("%f",&stu[i].score3);
printf("\n\n");
i++;
now_no=i;
printf("%d",now_no);
printf("是否繼續輸入?(Y/N)");
ch=getch();
system("cls");
}
while(ch!='n');
system("cls");
}
void sort()//排序數據函數
{
struct student temp;
int i,j;
for(i=1;i<now_no;i++)
{
for(j=1;j<=now_no-i;j++)
{
if(stu[j-1].ave<stu[j].ave)
{temp=stu[j];
stu[j]=stu[j-1];
stu[j-1]=temp;
}}}
}
void display()//顯示數據函數
{
int i;
char as;
float ave;
do
{
printf("\t\t班級學員信息列表\n");
printf("\t編號\t姓名\t性別\t成績\t成績\t成績\t平均值\n");
for(i=0;i<now_no;i++)
{
stu[i].sum=stu[i].score1+stu[i].score2+stu[i].score3;
stu[i].ave=stu[i].sum/3;
printf("\t%d\t%s\t%s\t%.2f\t%.2f\t%.2f\t%.2f\n",stu[i].no,stu[i].name,stu[i].sex,stu[i].score1,stu[i].score2,stu[i].score3,stu[i].ave);
}
printf("\t\t按任意鍵返回主菜單.");
as=getch();
goto exit;
}
while(as!='n');
exit: system("cls");
}
void insert()//插入數據函數
{
char ch;
do
{
printf("\n\t\t輸入新插入學員隊信息\n");
printf("\n輸入學生編號:");
scanf("%d",&stu[now_no].no);
fflush(stdin);
printf("\n輸入學員姓名:");
fflush(stdin);
gets(stu[now_no].name);
printf("\n輸入學員性別:");
fflush(stdin);
gets(stu[now_no].sex);
printf("\n輸入學員成績:");
fflush(stdin);
scanf("%f",&stu[now_no].score1);
printf("\n輸入學員成績:");
fflush(stdin);
scanf("%f",&stu[now_no].score2);
printf("\n輸入學員成績:");
fflush(stdin);
scanf("%f",&stu[now_no].score3);
printf("\n\n");
now_no=now_no+1;
sort();
printf("是否繼續輸入?(Y/N)");
ch=getch();
system("cls");
}
while(ch!='n');
}
void del()//刪除數據函數
{
int inum,i,j;
printf("輸入要刪除學員的編號:");
fflush(stdin);
scanf("%d",&inum);
for(i=0;i<now_no;i++)
{
if(stu[i].no==inum)
{
for(j=i;j<now_no;j++)
{
stu[i]=stu[i+1];
}
now_no=now_no-1;
}
break;
}
system("cls");
}

㈤ c語言編寫程序,實現簡易學生管理系統

教編程的那些教育機構真特么夠懶的,好像幾十年都一道題,學生管理系統?太特么簡單了

㈥ 教務信息管理系統(C語言)

/* Note:Your choice is C IDE */
#include <stdio.h>

struct Student
{
int num;
char name[20];
float score[3];
float avg;
}stus[30];

void Add(float*);/*填加學員*/
void List();/*/學員詳細列表 */
void Asc();/*/顯示後三名學員 */
void Desc();/*/顯示前三名學員*/
void Display();

void main()
{
int s;
float xxx;

while(1)
{
printf("Students System:\n");
printf("1. Add Student\n");
printf("2. Student list\n");
printf("3. Display the before Three\n");
printf("4. Display the last three NUm\n");
printf("5. Display the average\n");
printf("6. Exit\n");
printf("Please input select:\t");
scanf("%d",&s);

switch(s)
{
case 1:
Add(&xxx);
break;
case 2:
List();
break;
case 3:
Desc();
Display();
break;
case 4:
Asc();
Display();
break;
case 5:
Display();
break;
case 6:
return;
break;
default:
printf("Select Wrong!\n");
break;
}
}
}

void Add(float* p)
{
int i,k;
float sum;
char c;

for(i=0;i<30;i++)
{
printf("Input the num %d student Information:\n",i+1);
printf("Num:");
scanf("%d",&stus[i].num);
printf("Name:");
fflush(stdin);
scanf("%s",stus[i].name);
printf("Please the before three chenji:\n");

sum=0;
for(k=0;k<3;k++)
{
printf("%d:",k+1);
scanf("%f",p);
stus[i].score[k]=*p;
sum+=stus[i].score[k];
}
stus[i].avg=sum/3;

printf("Is go on?");
fflush(stdin);
scanf("%c",&c);

if(c=='n' || c=='N')
return;
}

}

void List()
{
int i,j=0;
printf("Num\tName\tChenji1\tChenji2\tChenji3\tAverage\n");
for(i=0;i<30;i++)
{
if(stus[i].num!=0)
{
printf("%d\t%s\t%.2f\t%.2f\t%.2f\t%.2f\n",stus[i].num,stus[i].name,stus[i].score[0],stus[i].score[1],stus[i].score[2],stus[i].avg);

}
}

}

void Asc()
{
int i,j;
struct Student c;
for(i=0;i<30;i++)
{ for(j=0;j<29-i;j++)
if(stus[j].avg<stus[j+1].avg)
{
c=stus[j];
stus[j]=stus[j+1];
stus[j+1]=c;
}
}
}

void Desc()
{
int i,j;
struct Student c;
for(i=0;i<30;i++)
{ for(j=0;j<29-i;j++)
if(stus[j].avg>stus[j+1].avg)
{
c=stus[j];
stus[j]=stus[j+1];
stus[j+1]=c;
}
}
}

void Display()
{
int i,d=0;
printf("Num\tName\tAverage\n");
for(i=0;i<30;i++)
{
if(stus[i].num!=0)
{
printf("%d\t%s\t%.2f\n",stus[i].num,stus[i].name,stus[i].avg);
d++;
}
if(d==3)
break;
}

}
在樓上的這位基礎上稍候修改了一下,因為其在TC中不能正常編譯.......

㈦ 用c語言或c++編程做教務處課程管理系統

可以用MFC做,我做過教師住房管理系統,就是用MFC做的。這個作業不難,練練手,以後找工作時比較有底氣。

㈧ C語言簡單的學生信息管理系統

這個最簡單了,適合初學者
#include "string.h"
#include "stdio.h"
#define N 30
int n=0;

/* 學生信息數據結構 */

struct student
{
char Sname[20];
char Snum[20];
char Sage[3];
char Sclass[10];
char Smayor[30];
}Stu[N];

/* 錄入函數實現 */
void ReadData()
{
printf("請輸入學生信息:\n姓名:");
scanf("%s",Stu[n].Sname);
printf("學號:");
scanf("%s",Stu[n].Snum);
printf("年齡:");
scanf("%s",Stu[n].Sage);
printf("班級:");
scanf("%s",Stu[n].Sclass);
printf("專業:");
scanf("%s",Stu[n].Smayor);
n++;
}
/* 顯示函數實現 */
void ShowData()
{
printf("姓名 學號 年齡 班級 專業\n");
for(int i=0;i<n;i++)
{
printf("%s %s %s",Stu[i].Sname,Stu[i].Snum,Stu[i].Sage);
printf(" %s %s\n",Stu[i].Sclass,Stu[i].Smayor);
}
}
/* 查找函數實現 */
void FindData()
{
char Stuname1[20];
printf("請輸入學生姓名:");
scanf("%s",Stuname1);
printf("\n");
for(int i=0;i<n;i++)
if(strcmp(Stu[i].Sname,Stuname1)==0)
{
printf("姓名:%s 學號:%s 年齡:%s ",Stu[i].Sname,Stu[i].Snum,Stu[i].Sage);
printf("班級:%s 專業:%s\n",Stu[i].Sclass,Stu[i].Smayor);
}
}
/* 刪除函數實現 */
void DeleData()
{
char Stuname2[20];
printf("請輸入學生姓名:");
scanf("%s",Stuname2);
printf("\n");
for(int i=0;i<n;i++)
if(strcmp(Stu[i].Sname,Stuname2)==0)
{
for(;i<n-1;i++)
for(int j=0;j<20;j++)
Stu[i].Sname[j]=Stu[i+1].Sname[j];
n--;
}
}
/* 入口函數實現 */
void main()
{
int option;
option=6;
printf("\n 學生信息管理系統 \n");
while(option!=5)
{
if(option!=5)
{
printf("\n\n 1.錄入 2.顯示 3.查找\n");
printf(" 4.刪除 5.退出 請選擇:");
scanf("%d",&option);
printf("\n");
switch(option)
{
case 1: ReadData();break;
case 2: ShowData();break;
case 3: FindData();break;
case 4: DeleData();break;
default: printf("數據輸入有誤!\n");break;
}//switch
}//if
}//while
}

㈨ 可以用c語言編寫簡單的成績管理系統是什麼水平,之後該如何進一步學習,使用什麼資料求前輩指點

一般大學C語言課程學完後,學生都能寫出成績管理系統(使用數組或者鏈表),初級水平而已。隨後就要深入學習多種數據結構和演算法。如果要基於linux或unix編程,就重點學習網路編程,通信協議等。如果要基於windows編程,就進一步學習C++,最好使用微軟的編譯器。

㈩ 用c語言編教務管理系統

#include<iostream>
#include<string.h>
using namespace std;
struct student
{
char name[50];
int score;

};
void teacherC(student *stu)//老師錄入成績
{
int i,n;
cout<<"請輸入需要錄入的學生的個數\n";
cin>>n;
cout<<"請依次輸入學生的姓名和成績\n";
for(i=0;i<n;i++)
{
cin>>stu[i].name>>stu[i].score;
}
stu[i].score=-1;
}
void show(student *stu)
{
int i=0;

for(;i<100;i++)
{
if(stu[i].score==-1)
break;
cout<<stu[i].name<<" "<<stu[i].score<<endl;

}
}
int search(student *stu,char *name)
{
int i=0,k=-1;
for(;i<100;i++)
{
if(stu[i].score==-1)
break;
if(strcmp(stu[i].name,name)==0)
{
k=i;
break;

}
}
return k;
}
void edit(student *stu)
{
int i=0,j=0;
char name[30],an;
while(1)
{
cout<<"請輸入需要修改的學生名字\n";
cin>>name;
i=search(stu,name);
if(i>=0)
{
cout<<"該學生的信息為:\n";
cout<<stu[i].name<<" "<<stu[i].score<<endl;
cout<<"確定要修改該學生的信息是的輸入Y不是輸入N:\n";
cin>>an;
if(an=='Y'||an=='y')
{
cout<<"請輸入修改後的姓名成績:\n";
cin>>stu[i].name>>stu[i].score;
cout<<"修改成功\n";
}
cout<<"繼續修改請輸入1退出輸入0:\n";
cin>>j;
if(j==0)
break;
}
else
cout<<"沒有該學生的信息\n";

}
}
void dele(student *stu)
{

int i=0,j=0;
char name[30],an;
while(1)
{
cout<<"請輸入需要刪除的學生名字\n";
cin>>name;
i=search(stu,name);
if(i>0)
{
cout<<"該學生的信息為:\n";
cout<<stu[i].name<<" "<<stu[i].score<<endl;
cout<<"確定要刪除該學生的信息是的輸入Y不是輸入N:\n";
cin>>an;
if(an=='Y'||an=='y')
{
*stu[i].name=0;
cout<<"刪除成功\n";
}
cout<<"繼續刪除請輸入1退出輸入0:\n";
cin>>j;
if(j==0)
break;
}
else
cout<<"沒有該學生的信息\n";

}

}
int main()
{
int i,n;
char name[30];
student stu[100];//學生總數上限為100個
while(1)
{
cout<<"請做出以下的選擇:"<<endl;
cout<<"輸入 0 退出系統\n";
cout<<"輸入 1 教書錄入成績\n";
cout<<"輸入 2 學生查詢成績\n";
cout<<"輸入 3 修改學生成績\n";
cout<<"輸入 4 刪除學生成績\n";
cin>>i;
switch(i)
{
case 1: teacherC(stu);break;
case 2: cout<<"請輸入查詢的姓名\n";
cin>>name;n=search(stu,name);cout<<"該學生成績是:"<<stu[n].score<<endl;break;
case 3: edit(stu);break;
case 4: dele(stu);break;
default:if(i!=0)cout<<"請輸入有效數字\n";
}
if(i==0)
break;
}

return 0;
}