當前位置:編程學習大全網 - 源碼下載 - 學校管理手機源代碼

學校管理手機源代碼

我已經調試了源代碼,並成功在VC++上運行。

#include "stdio.h" /*I/O函數*/

#include "stdlib.h" /*其他註釋*/

#include "string.h" /*字符串函數*/

#包含“conio . h”/*屏幕操作功能*/

#include "mem.h" /*存儲器操作功能*/

#include "ctype.h" /*字符操作函數*/

#include "alloc.h" /*動態地址分配函數*/

結構分數

{

int明詞;

char雪豪[8];

夏爾·子明[20];

浮動分數[6];

}data,info[1000];

int i,j,k = 0;

char temp[20],ch;

FILE *fp,* FP 1;

虛空舒茹()

{

if((fp=fopen("s_score.txt "," a b+ ")= = NULL)

{

printf("無法打開該文件。\ n ");

getch();退出(0);

}

for(I = 0;我& lt=1000;i++)

{

printf(" \ n請舒茹雪號:");

gets(data . xuehao);

printf("請舒如子明:");

gets(data . mingzi);

printf("請舒如虞雯評分:");

獲取(temp);data . score[0]= atof(temp);

printf("請舒茹舒雪評分:");

獲取(temp);data . score[1]= atof(temp);

printf("請輸入於穎分數:");

獲取(temp);data . score[2]= atof(temp);

printf("請舒如wuli評分:");

獲取(temp);data . score[3]= atof(temp);

printf("Please shur華學評分:");

獲取(temp);data . score[4]= atof(temp);

data . score[5]= data . score[0]+data . score[1]+data . score[2]+data . score[3]+data . score[4];

fwrite(& amp;data,sizeof(data),1,FP);

printf("另壹個?y/n”);

ch = getch();

if(ch=='n'||ch=='N ')

打破;

} f close(FP);

}

無效石現()

{

float s;int n;

if((fp=fopen("s_score.txt "," r b+ ")= = NULL)

{

printf("無法讀取該文件。\ n ");

退出(0);

}

for(I = 0;我& lt=1000;i++)

{

if((fread(& amp;info[i],sizeof(info[i]),1,fp)!=1)

打破;

}

printf(" \ n雪豪子明虞雯淑雪於穎wuli花絮雪中粉\ n ");

for(j=0,k = 1;j & lt我;j++,k++)

{

信息[j]。明詞= k;

printf(" % 6s % 8s % 3.1f % 3.1f % 3.1f % 3.1f % 3.1f % 3.1f \ n ",info[j]。雪浩,info[j]。子明,信息[j]。分數[0],信息[j]。分數[1],信息[j]。分數[2],信息[j]。分數[3],信息[j]。得分[4],

信息[j]。得分[5]);

}

getch();

fclose(FP);

}

作廢修改()

{

if((fp=fopen("s_score.txt "," r b+ ")= = NULL | |(FP 1 = fopen(" temp . txt "," w b+ ")= = NULL)

{

printf("無法打開該文件。\ n ");

退出(0);

}

printf(" \ n請舒如修蓋學號:");

scanf("%d ",& ampI);getchar();

而((fread(& amp;data,sizeof(data),1,fp))==1)

{

j = atoi(data . xuehao);

如果(j==i)

{

printf("學號:%s\n明子:% s \ n ",data.xuehao,data . mingzi);

printf("請舒如子明:");

gets(data . mingzi);

printf("請舒如虞雯評分:");

獲取(temp);data . score[0]= atof(temp);

printf("請舒茹舒雪評分:");

獲取(temp);data . score[1]= atof(temp);

printf("請輸入於穎分數:");

獲取(temp);data . score[2]= atof(temp);

printf("請輸入wuli分數:");

獲取(temp);data . score[3]= atof(temp);

printf("請輸入華學分數:");

獲取(temp);data . score[4]= atof(temp);

data . score[5]= data . score[0]+data . score[1]+data . score[2]+data . score[3]+data . score[4];

} fwrite(& amp;data,sizeof(data),1,FP 1);

}

fseek(fp,0L,0);

fseek(fp1,0L,0);

而((fread(& amp;data,sizeof(data),1,fp1))==1)

{

fwrite(& amp;data,sizeof(data),1,FP);

}

fclose(FP);

fclose(FP 1);

}

void chazhao()

{

if((fp=fopen("s_score.txt "," Rb ")= = NULL)

{

printf(" \ n無法打開此文件。\ n ");

退出(0);

}

printf(" \ n請舒茹雪浩查勘:");

scanf("%d ",& ampI);

while(fread(& amp;data,sizeof(data),1,fp)==1)

{

j = atoi(data . xuehao);

如果(i==j)

{

printf("學號:%s子明:%s\nyuwen:%f\n書號:%f\n於穎:%f\n wuli:%f\n花號:%f\n ",data.xuehao,data.mingzi,data.score[0],data.score[1],data.score[2],data.score[3],data.score[4],data . score[5]);

} getch();

}

}

虛空山初()

{

if((fp=fopen("s_score.txt "," r b+ ")= = NULL | |(FP 1 = fopen(" temp . txt "," w b+ ")= = NULL)

{

printf(" \ n打開score.txt失敗!");

getch();

退出(0);

}

printf(" \ n請輸入您要刪除的ID:");

scanf("%d ",& ampI);getchar();

而((fread(& amp;data,sizeof(data),1,fp))==1)

{

j = atoi(data . xuehao);

如果(j==i)

{

printf("Anykey將刪除它。\ n ");

getch();

繼續;

}

fwrite(& amp;data,sizeof(data),1,FP 1);

}

fclose(FP);

fclose(FP 1);

remove(" s _ score . txt ");

重命名(" temp.txt "," s _ score . txt ");

printf("數據刪除成功!\ n ");

printf("Anykey將返回main。");

getch();

}

主()

{

while(1)

{

clr SCR();/*清空屏幕*/

gotoxy(1,1);/*移動光標*/

textcolor(黃色);/*將文本顯示顏色設置為黃色*/

textbackground(藍色);/*將背景顏色設置為藍色*/

窗口(1,1,99,99);/*制作壹個顯示菜單的窗口,窗口的大小根據菜單的數量來設計*/

clr SCR();

printf("************歡迎使用學生管理* * * * * * * * * * * * * * * * \ n ");

printf(" * * * * * * * * * * * * * * * * * * * * * * * * * *菜單* * * * * * * * * * * * * * * * * * * * * * * * * * * * \ n ");

printf(" * = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = * \ n ");

printf(" * 1 & gt;shuru 2 & gtxiu Gai * \ n ");

printf(" * 3 & gt;山初4 & gtcha Zhao * \ n ");

printf(" * 5 & gt;石現6 & gtexit * \ n ");

printf(" * * \ n ");

printf(" *-* \ n ");

printf("請輸入妳想要的(1-6):");

ch = getch();

開關(通道)

{

case ' 1 ':shuru();打破;

案例‘2’:修改();打破;

案例‘3’:山初();打破;

case ' 4 ':cha Zhao();打破;

案例‘5’:石現();打破;

案例“6”:出口(0);

默認:繼續;

}

}

  • 上一篇:如何正確的使用UNITY3D制作FPS遊戲
  • 下一篇:CRM指的是什麽
  • copyright 2024編程學習大全網