C语言实习:学生成绩管理系统(16)
发布时间:2021-06-07
发布时间:2021-06-07
}
printf("\nPlease input ID which you want to del:"); scanf("%d",&i);getchar();
while((fread(&data,sizeof(data),1,fp))==1) {
j=atoi(data.xuehao); if(j==i) {
printf("Anykey will delet it.\n"); getch(); continue; }
fwrite(&data,sizeof(data),1,fp1); }
fclose(fp); fclose(fp1);
remove("s_score.txt");
rename("temp.txt","s_score.txt");
printf("Data delet was succesful!\n"); printf("Anykey will return to main."); getch(); }
main() {
while(1) {
clrscr();
printf("*************welcome to use student manage******************\n"); printf("*************************menu********************************\n"); printf("* ========================================================= * \n"); printf("* A>shuru B>xiugai * \n"); printf("* C>shanchu D>chazhao * \n"); printf("*E>xianshi F>exit * \n"); printf("* * \n");
printf("* --------------------------------------------------------- * \n"); printf(" Please input which you want(A-F):"); ch=getch(); switch(ch) {
case 'A':shuru();break; case 'B':xiugai(); break; case 'C':shanchu(); break;