C语言编写一个删除的程序 就是学生管理的那种
发布网友
发布时间:2022-08-17 07:07
我来回答
共4个回答
热心网友
时间:2023-10-10 21:26
#include "stdio.h"
/*定义学生结构体*/
struct Student
{
char ID[20];
char Name[20];
float Mark1;
float Mark2;
float Mark3;
float Average;
};
/*声明学生数组及学生数量*/
struct Student students[1000];
int num=0;
/*求平均值*/
float Avg(struct Student stu)
{
return (stu.Mark1+stu.Mark2+stu.Mark3)/3;
}
/*通过学号返回数组下标*/
int Student_SearchByIndex(char id[])
{
int i;
for (i=0;i<num;i++)
{
if (strcmp(students[i].ID,id)==0)
{
return i;
}
}
return -1;
}
/*通过姓名返回数组下标*/
int Student_SearchByName(char name[])
{
int i;
for (i=0;i<num;i++)
{
if (strcmp(students[i].Name,name)==0)
{
return i;
}
}
return -1;
}
/*显示单条学生记录*/
void Student_DisplaySingle(int index)
{
printf("%10s%10s%8s%8s%8s%10s\n","学号","姓名","成绩","成绩","成绩","平均成绩");
printf("-------------------------------------------------------------\n");
printf("%10s%10s%8.2f%8.2f%8.2f%10.2f\n",students[index].ID,students[index].Name,
students[index].Mark1,students[index].Mark2,students[index].Mark3,students[index].Average);
}
/*插入学生信息*/
void Student_Insert()
{
while(1)
{
printf("请输入学号:");
scanf("%s",&students[num].ID);
getchar();
printf("请输入姓名:");
scanf("%s",&students[num].Name);
getchar();
printf("请输入成绩:");
scanf("%f",&students[num].Mark1);
getchar();
printf("请输入成绩:");
scanf("%f",&students[num].Mark2);
getchar();
printf("请输入成绩:");
scanf("%f",&students[num].Mark3);
getchar();
students[num].Average=Avg(students[num]);
num++;
printf("是否继续?(y/n)");
if (getchar()=='n')
{
break;
}
}
}
/*修改学生信息*/
void Student_Modify()
{
float mark1,mark2,mark3;
while(1)
{
char id[20];
int index;
printf("请输入要修改的学生的学号:");
scanf("%s",&id);
getchar();
index=Student_SearchByIndex(id);
if (index==-1)
{
printf("学生不存在!\n");
}
else
{
printf("你要修改的学生信息为:\n");
Student_DisplaySingle(index);
printf("-- 请输入新值--\n");
printf("请输入学号:");
scanf("%s",&students[index].ID);
getchar();
printf("请输入姓名:");
scanf("%s",&students[index].Name);
getchar();
printf("请输入成绩:");
scanf("%f",&students[index].Mark1);
getchar();
printf("请输入成绩:");
scanf("%f",&students[index].Mark2);
getchar();
printf("请输入成绩:");
scanf("%f",&students[index].Mark3);
getchar();
students[index].Average=Avg(students[index]);
}
printf("是否继续?(y/n)");
if (getchar()=='n')
{
break;
}
}
}
/*删除学生信息*/
void Student_Delete()
{
int i;
while(1)
{
char id[20];
int index;
printf("请输入要删除的学生的学号:");
scanf("%s",&id);
getchar();
index=Student_SearchByIndex(id);
if (index==-1)
{
printf("学生不存在!\n");
}
else
{
printf("你要删除的学生信息为:\n");
Student_DisplaySingle(index);
printf("是否真的要删除?(y/n)");
if (getchar()=='y')
{
for (i=index;i<num-1;i++)
{
students[i]=students[i+1];
}
num--;
}
getchar();
}
printf("是否继续?(y/n)");
if (getchar()=='n')
{
break;
}
}
}
/*按姓名查询*/
void Student_Select()
{
while(1)
{
char name[20];
int index;
printf("请输入要查询的学生的姓名:");
scanf("%s",&name);
getchar();
index=Student_SearchByName(name);
if (index==-1)
{
printf("学生不存在!\n");
}
else
{
printf("你要查询的学生信息为:\n");
Student_DisplaySingle(index);
}
printf("是否继续?(y/n)");
if (getchar()=='n')
{
break;
}
}
}
/*按平均值排序*/
void Student_SortByAverage()
{
int i,j;
struct Student tmp;
for (i=0;i<num;i++)
{
for (j=1;j<num-i;j++)
{
if (students[j-1].Average<students[j].Average)
{
tmp=students[j-1];
students[j-1]=students[j];
students[j]=tmp;
}
}
}
}
/*显示学生信息*/
void Student_Display()
{
int i;
printf("%10s%10s%8s%8s%8s%10s\n","学号","姓名","成绩","成绩","成绩","平均成绩");
printf("-------------------------------------------------------------\n");
for (i=0;i<num;i++)
{
printf("%10s%10s%8.2f%8.2f%8.2f%10.2f\n",students[i].ID,students[i].Name,
students[i].Mark1,students[i].Mark2,students[i].Mark3,students[i].Average);
}
}
/*将学生信息从文件读出*/
void IO_ReadInfo()
{
FILE *fp;
int i;
if ((fp=fopen("Database.txt","rb"))==NULL)
{
printf("不能打开文件!\n");
return;
}
if (fread(&num,sizeof(int),1,fp)!=1)
{
num=-1;
}
else
{
for(i=0;i<num;i++)
{
fread(&students[i],sizeof(struct Student),1,fp);
}
}
fclose(fp);
}
/*将学生信息写入文件*/
void IO_WriteInfo()
{
FILE *fp;
int i;
if ((fp=fopen("Database.txt","wb"))==NULL)
{
printf("不能打开文件!\n");
return;
}
if (fwrite(&num,sizeof(int),1,fp)!=1)
{
printf("写入文件错误!\n");
}
for (i=0;i<num;i++)
{
if (fwrite(&students[i],sizeof(struct Student),1,fp)!=1)
{
printf("写入文件错误!\n");
}
}
fclose(fp);
}
/*主程序*/
main()
{
int choice;
IO_ReadInfo();
while(1)
{
/*主菜单*/
printf("\n------ 学生成绩管理系统------\n");
printf("1. 增加学生记录\n");
printf("2. 修改学生记录\n");
printf("3. 删除学生记录\n");
printf("4. 按姓名查询学生记录\n");
printf("5. 按平均成绩排序\n");
printf("6. 退出\n");
printf("请选择(1-6):");
scanf("%d",&choice);
getchar();
switch(choice)
{
case 1:
Student_Insert();
break;
case 2:
Student_Modify();
break;
case 3:
Student_Delete();
break;
case 4:
Student_Select();
break;
case 5:
Student_SortByAverage();
Student_Display();
break;
case 6:
exit(); 我运行时出现问题,运行软件为C-free,所以将此行 改为void exit(int);即可,也许你不需要更改就可运行,请注意!!
break;
}
IO_WriteInfo();
}
}
热心网友
时间:2023-10-10 21:26
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define szSTR 64
#define fileDB "c:\\contact.txt"
struct CONTACT {
char name[szSTR];/*姓名*/
char unit[szSTR];/*工作单位*/
char tele[szSTR];/*电话*/
char mail[szSTR];/*mail*/
};
typedef struct CONTACT CON;
#define BNAME 1
#define BUNIT 2
#define BTELE 4
#define BMAIL 8
#define BFULL 0xFF
int OPER[5] = {BFULL, BNAME, BUNIT, BTELE, BMAIL};
void input(CON * s, int mask)
{
if(mask & BNAME) { printf("请输入学生姓名:"); scanf("%s", s->name); }
if(mask & BUNIT) { printf("请输入工作单位:"); scanf("%s", s->unit); }
if(mask & BTELE) { printf("请输入联系电话:"); scanf("%s", s->tele); }
if(mask & BMAIL) { printf("请输入电子邮件:"); scanf("%s", s->mail); }
}/*end input*/
void show (int id, CON * s)
{
if(!s) return ;
if(id)
printf("%d\t%s\t%s\t%s\t%s\n",
id, s->name , s->unit , s->tele , s->mail );
else
printf("【姓名】%s【工作单位】%s【电话】%s【电邮】%s\n",
s->name , s->unit , s->tele , s->mail );
/*end if*/
}/*end show*/
void regist(void)
{
CON s; FILE * f = 0;
input(&s, BFULL);
f = fopen(fileDB, "ab");
fwrite(&s,sizeof(s),1,f);
fclose(f);
printf("资料已保存!\n");
}/*end regist*/
int browse(char * key, fpos_t * p, CON * s)
{
FILE * f =0; int i = 0, r = 0; CON t;
char * a = 0, * b = 0; fpos_t q;
if(!s) return 0;
f = fopen(fileDB, "rb");
if(!f) {
printf("数据库暂无记录\n");
return 0;
}/*end if*/
printf("编号\t姓名\t单位\t电话\t电邮\n");
printf("------------------------------------------------\n");
while(!feof(f)) {
fgetpos(f, &q);
r = fread(&t, sizeof(t), 1, f);
if(r<1)break;
if(t.name[0]==0) continue;
if(key) {
a = strstr(t.name , key);
b = strstr(t.tele , key);
if(a == 0 && b == 0) continue;
}/*end if*/
if(p) *p = q;
if(s) memcpy(s, &t, sizeof(t));
i++;
show(i, &t);
}/*end while*/
fclose(f);
printf("------------------------------------------------\n");
return i;
}/*end browse*/
fpos_t query(CON * s)
{
char key[szSTR]=""; fpos_t p = 0; int r = 0;
printf("请输入姓名或者电话号码:");
scanf("%s", key);
r = browse(key, &p, s);
return r?p:-1;
}/*end query*/
void clear(void)
{
FILE * f = 0; CON s;
fpos_t p = query(&s);
if(p<0) return;
f = fopen(fileDB, "rb+");
fsetpos(f, &p);
memset(&s, 0, sizeof(s));
fwrite(&s, sizeof(s),1, f);
fclose(f);
printf("记录已删除!\n");
}/*end clear*/
void modify(void)
{
FILE * f = 0; CON s; int cmd = 0;
fpos_t p = query(&s);
if(p<0) return;
f = fopen(fileDB, "rb+");
fsetpos(f, &p);
for(;;) {
show(0, &s);
printf("请选择:1-姓名;2-工作单位;3-电话;4-电邮;5-保存并退出;6-放弃修改并退出\n");
scanf("%d", &cmd);
switch(cmd) {
case 1:
case 2:
case 3:
case 4:
input(&s, OPER[cmd]);
break;
case 5:
fsetpos(f, &p);
fwrite(&s, sizeof(s), 1, f);
case 6:
fclose(f);
return;
default:
printf("错误的操作,请重新输入。\n");
}/*end case*/
}/*mext*/
}/*end clear*/
int main(void)
{
int cmd = 0; CON s;
for(;;) {
printf("欢迎使用通信簿!请选择:1-添加;2-查询;3-删除;4-修改;5-全部输出;0-退出\n");
scanf("%d", &cmd);
switch(cmd) {
case 0: return 0;
case 1: regist(); break;
case 2: query(&s); break;
case 3: clear(); break;
case 4: modify(); break;
case 5: browse(0, 0, &s); break;
}//end case
}
return 0;
}
热心网友
时间:2023-10-10 21:26
例如删除“课程信息表”中课程ID为“JB0003”的记录:
delete from 课程信息表
where 课程ID ="JB0003"
热心网友
时间:2023-10-10 21:27
指针都没学怎么会有这样的题目
热心网友
时间:2023-10-10 21:26
#include "stdio.h"
/*定义学生结构体*/
struct Student
{
char ID[20];
char Name[20];
float Mark1;
float Mark2;
float Mark3;
float Average;
};
/*声明学生数组及学生数量*/
struct Student students[1000];
int num=0;
/*求平均值*/
float Avg(struct Student stu)
{
return (stu.Mark1+stu.Mark2+stu.Mark3)/3;
}
/*通过学号返回数组下标*/
int Student_SearchByIndex(char id[])
{
int i;
for (i=0;i<num;i++)
{
if (strcmp(students[i].ID,id)==0)
{
return i;
}
}
return -1;
}
/*通过姓名返回数组下标*/
int Student_SearchByName(char name[])
{
int i;
for (i=0;i<num;i++)
{
if (strcmp(students[i].Name,name)==0)
{
return i;
}
}
return -1;
}
/*显示单条学生记录*/
void Student_DisplaySingle(int index)
{
printf("%10s%10s%8s%8s%8s%10s\n","学号","姓名","成绩","成绩","成绩","平均成绩");
printf("-------------------------------------------------------------\n");
printf("%10s%10s%8.2f%8.2f%8.2f%10.2f\n",students[index].ID,students[index].Name,
students[index].Mark1,students[index].Mark2,students[index].Mark3,students[index].Average);
}
/*插入学生信息*/
void Student_Insert()
{
while(1)
{
printf("请输入学号:");
scanf("%s",&students[num].ID);
getchar();
printf("请输入姓名:");
scanf("%s",&students[num].Name);
getchar();
printf("请输入成绩:");
scanf("%f",&students[num].Mark1);
getchar();
printf("请输入成绩:");
scanf("%f",&students[num].Mark2);
getchar();
printf("请输入成绩:");
scanf("%f",&students[num].Mark3);
getchar();
students[num].Average=Avg(students[num]);
num++;
printf("是否继续?(y/n)");
if (getchar()=='n')
{
break;
}
}
}
/*修改学生信息*/
void Student_Modify()
{
float mark1,mark2,mark3;
while(1)
{
char id[20];
int index;
printf("请输入要修改的学生的学号:");
scanf("%s",&id);
getchar();
index=Student_SearchByIndex(id);
if (index==-1)
{
printf("学生不存在!\n");
}
else
{
printf("你要修改的学生信息为:\n");
Student_DisplaySingle(index);
printf("-- 请输入新值--\n");
printf("请输入学号:");
scanf("%s",&students[index].ID);
getchar();
printf("请输入姓名:");
scanf("%s",&students[index].Name);
getchar();
printf("请输入成绩:");
scanf("%f",&students[index].Mark1);
getchar();
printf("请输入成绩:");
scanf("%f",&students[index].Mark2);
getchar();
printf("请输入成绩:");
scanf("%f",&students[index].Mark3);
getchar();
students[index].Average=Avg(students[index]);
}
printf("是否继续?(y/n)");
if (getchar()=='n')
{
break;
}
}
}
/*删除学生信息*/
void Student_Delete()
{
int i;
while(1)
{
char id[20];
int index;
printf("请输入要删除的学生的学号:");
scanf("%s",&id);
getchar();
index=Student_SearchByIndex(id);
if (index==-1)
{
printf("学生不存在!\n");
}
else
{
printf("你要删除的学生信息为:\n");
Student_DisplaySingle(index);
printf("是否真的要删除?(y/n)");
if (getchar()=='y')
{
for (i=index;i<num-1;i++)
{
students[i]=students[i+1];
}
num--;
}
getchar();
}
printf("是否继续?(y/n)");
if (getchar()=='n')
{
break;
}
}
}
/*按姓名查询*/
void Student_Select()
{
while(1)
{
char name[20];
int index;
printf("请输入要查询的学生的姓名:");
scanf("%s",&name);
getchar();
index=Student_SearchByName(name);
if (index==-1)
{
printf("学生不存在!\n");
}
else
{
printf("你要查询的学生信息为:\n");
Student_DisplaySingle(index);
}
printf("是否继续?(y/n)");
if (getchar()=='n')
{
break;
}
}
}
/*按平均值排序*/
void Student_SortByAverage()
{
int i,j;
struct Student tmp;
for (i=0;i<num;i++)
{
for (j=1;j<num-i;j++)
{
if (students[j-1].Average<students[j].Average)
{
tmp=students[j-1];
students[j-1]=students[j];
students[j]=tmp;
}
}
}
}
/*显示学生信息*/
void Student_Display()
{
int i;
printf("%10s%10s%8s%8s%8s%10s\n","学号","姓名","成绩","成绩","成绩","平均成绩");
printf("-------------------------------------------------------------\n");
for (i=0;i<num;i++)
{
printf("%10s%10s%8.2f%8.2f%8.2f%10.2f\n",students[i].ID,students[i].Name,
students[i].Mark1,students[i].Mark2,students[i].Mark3,students[i].Average);
}
}
/*将学生信息从文件读出*/
void IO_ReadInfo()
{
FILE *fp;
int i;
if ((fp=fopen("Database.txt","rb"))==NULL)
{
printf("不能打开文件!\n");
return;
}
if (fread(&num,sizeof(int),1,fp)!=1)
{
num=-1;
}
else
{
for(i=0;i<num;i++)
{
fread(&students[i],sizeof(struct Student),1,fp);
}
}
fclose(fp);
}
/*将学生信息写入文件*/
void IO_WriteInfo()
{
FILE *fp;
int i;
if ((fp=fopen("Database.txt","wb"))==NULL)
{
printf("不能打开文件!\n");
return;
}
if (fwrite(&num,sizeof(int),1,fp)!=1)
{
printf("写入文件错误!\n");
}
for (i=0;i<num;i++)
{
if (fwrite(&students[i],sizeof(struct Student),1,fp)!=1)
{
printf("写入文件错误!\n");
}
}
fclose(fp);
}
/*主程序*/
main()
{
int choice;
IO_ReadInfo();
while(1)
{
/*主菜单*/
printf("\n------ 学生成绩管理系统------\n");
printf("1. 增加学生记录\n");
printf("2. 修改学生记录\n");
printf("3. 删除学生记录\n");
printf("4. 按姓名查询学生记录\n");
printf("5. 按平均成绩排序\n");
printf("6. 退出\n");
printf("请选择(1-6):");
scanf("%d",&choice);
getchar();
switch(choice)
{
case 1:
Student_Insert();
break;
case 2:
Student_Modify();
break;
case 3:
Student_Delete();
break;
case 4:
Student_Select();
break;
case 5:
Student_SortByAverage();
Student_Display();
break;
case 6:
exit(); 我运行时出现问题,运行软件为C-free,所以将此行 改为void exit(int);即可,也许你不需要更改就可运行,请注意!!
break;
}
IO_WriteInfo();
}
}
热心网友
时间:2023-10-10 21:26
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define szSTR 64
#define fileDB "c:\\contact.txt"
struct CONTACT {
char name[szSTR];/*姓名*/
char unit[szSTR];/*工作单位*/
char tele[szSTR];/*电话*/
char mail[szSTR];/*mail*/
};
typedef struct CONTACT CON;
#define BNAME 1
#define BUNIT 2
#define BTELE 4
#define BMAIL 8
#define BFULL 0xFF
int OPER[5] = {BFULL, BNAME, BUNIT, BTELE, BMAIL};
void input(CON * s, int mask)
{
if(mask & BNAME) { printf("请输入学生姓名:"); scanf("%s", s->name); }
if(mask & BUNIT) { printf("请输入工作单位:"); scanf("%s", s->unit); }
if(mask & BTELE) { printf("请输入联系电话:"); scanf("%s", s->tele); }
if(mask & BMAIL) { printf("请输入电子邮件:"); scanf("%s", s->mail); }
}/*end input*/
void show (int id, CON * s)
{
if(!s) return ;
if(id)
printf("%d\t%s\t%s\t%s\t%s\n",
id, s->name , s->unit , s->tele , s->mail );
else
printf("【姓名】%s【工作单位】%s【电话】%s【电邮】%s\n",
s->name , s->unit , s->tele , s->mail );
/*end if*/
}/*end show*/
void regist(void)
{
CON s; FILE * f = 0;
input(&s, BFULL);
f = fopen(fileDB, "ab");
fwrite(&s,sizeof(s),1,f);
fclose(f);
printf("资料已保存!\n");
}/*end regist*/
int browse(char * key, fpos_t * p, CON * s)
{
FILE * f =0; int i = 0, r = 0; CON t;
char * a = 0, * b = 0; fpos_t q;
if(!s) return 0;
f = fopen(fileDB, "rb");
if(!f) {
printf("数据库暂无记录\n");
return 0;
}/*end if*/
printf("编号\t姓名\t单位\t电话\t电邮\n");
printf("------------------------------------------------\n");
while(!feof(f)) {
fgetpos(f, &q);
r = fread(&t, sizeof(t), 1, f);
if(r<1)break;
if(t.name[0]==0) continue;
if(key) {
a = strstr(t.name , key);
b = strstr(t.tele , key);
if(a == 0 && b == 0) continue;
}/*end if*/
if(p) *p = q;
if(s) memcpy(s, &t, sizeof(t));
i++;
show(i, &t);
}/*end while*/
fclose(f);
printf("------------------------------------------------\n");
return i;
}/*end browse*/
fpos_t query(CON * s)
{
char key[szSTR]=""; fpos_t p = 0; int r = 0;
printf("请输入姓名或者电话号码:");
scanf("%s", key);
r = browse(key, &p, s);
return r?p:-1;
}/*end query*/
void clear(void)
{
FILE * f = 0; CON s;
fpos_t p = query(&s);
if(p<0) return;
f = fopen(fileDB, "rb+");
fsetpos(f, &p);
memset(&s, 0, sizeof(s));
fwrite(&s, sizeof(s),1, f);
fclose(f);
printf("记录已删除!\n");
}/*end clear*/
void modify(void)
{
FILE * f = 0; CON s; int cmd = 0;
fpos_t p = query(&s);
if(p<0) return;
f = fopen(fileDB, "rb+");
fsetpos(f, &p);
for(;;) {
show(0, &s);
printf("请选择:1-姓名;2-工作单位;3-电话;4-电邮;5-保存并退出;6-放弃修改并退出\n");
scanf("%d", &cmd);
switch(cmd) {
case 1:
case 2:
case 3:
case 4:
input(&s, OPER[cmd]);
break;
case 5:
fsetpos(f, &p);
fwrite(&s, sizeof(s), 1, f);
case 6:
fclose(f);
return;
default:
printf("错误的操作,请重新输入。\n");
}/*end case*/
}/*mext*/
}/*end clear*/
int main(void)
{
int cmd = 0; CON s;
for(;;) {
printf("欢迎使用通信簿!请选择:1-添加;2-查询;3-删除;4-修改;5-全部输出;0-退出\n");
scanf("%d", &cmd);
switch(cmd) {
case 0: return 0;
case 1: regist(); break;
case 2: query(&s); break;
case 3: clear(); break;
case 4: modify(); break;
case 5: browse(0, 0, &s); break;
}//end case
}
return 0;
}
热心网友
时间:2023-10-10 21:27
例如删除“课程信息表”中课程ID为“JB0003”的记录:
delete from 课程信息表
where 课程ID ="JB0003"
热心网友
时间:2023-10-10 21:27
指针都没学怎么会有这样的题目
用C语言写一个删除学生信息的程序。(要求有删除的函数)。
根据学号删除学生信息: 贴上代码(有点多) #include <stdio.h> #include <stdlib.h> //exit函数头文件 #include <string.h> //字符串相关操作头文件 #define MAX_STUDENT 30 //最大学生数 //函数声明,本程序共10个子函数,每个函数对应一个操作 void student_scanf(int n); void student_printf(i...
C语言学生信息系统,求帮忙做个删除信息部分,在线等,急~
void sDelete(double* Score,char (*Name)[17],int* studentCount){ int deletedName;int leftCount;system("CLS");printOnCenter("删除学生信息功能");showByTable(Score,Name,studentCount);deletedName = getDeletedName(Score,Name,studentCount);while(deletedName != -1){ leftCount = sDel...
编学生信息管理系统
这是一款用C语言编写的学生成绩管理系统,界面为DOS。系统能够读取和保存学生成绩信息,具备查询、添加、删除学生信息以及文件操作等功能。程序主体结构清晰,采用结构体形式存储学生成绩和基本信息。程序首先定义了结构体days和max,其中days包含年、月、日信息,max结构体则用于存储学生成绩和基本信息,如学号...
有关C语言程序(学生成绩管理程序)
void deleted(); /*删除学生记录*/void sort_select(); /*排序方式选择*/void sort_sum(); /*排序总分成绩*/void sort_china(); /*排序语文成绩*/void sort_math(); /*排序数学成绩*/void sort_english(); /*排序英语成绩*/不使用指针 展开 我来答 2个回答 #热议# 已婚女性就应该承担家里...
学生信息管理系统编程(c语言)
"1 - 新建学生信息\n""2 - 查找学生信息\n""3 - 修改学生信息\n""4 - 删除学生信息\n""5 - 打印学生信息\n""0 - 退出\n");scanf("%d", &choice);return choice;} int EnterAccount(void){ int ret;printf("请输入学号:\n");scanf("%d", &ret);if (ret >= 1 && ret <...
用c语言编写一个学生学籍管理系统
printf("请你输入要删除的姓名:"); scanf("%s",findmess); p=Locate(l,findmess,"name"); if(p) { r=l; while(r->next!=p) r=r->next; r->next=p->next; free(p); printf("\n===>提示:该学生已经成功删除!\n"); shoudsave=1; } else Nofind(); } else Wrong(); } void Modify...
c语言:学生管理系统
C语言实现的学生管理系统可以包含多种功能。其中一个关键功能是学生信息的排序。使用冒泡排序法,可以将学生信息按照平均成绩从高到低进行排序。具体步骤如下:首先初始化变量i,用于遍历数组。然后设置一个循环,从数组的最后一个元素开始,向前遍历。在循环内部,比较相邻两个元素的平均成绩,如果前一个...
C语言程序设计 题目:学生信息管理系统
1题目:学生信息管理系统2程序要求:(1)学生信息录入功能1)用户从键盘输入每个学生的信息:学号、姓名、性别、数学、英语、政治、语文四门课成绩。2)可插入一个或多个学生信息到当... 1题目:学生信息管理系统 2 程序要求:(1)学生信息录入功能 1)用户从键盘输入每个学生的信息:学号、姓名、性别、数学、英语、政治...
c语言学生管理系统
c语言学生管理系统 1。输入一个班的学生记录。2。显示所有记录。3。按学号对所有记录排序4。插入一条学生记录,按学号排好。5。按姓名查找,并删除一条记录。6。查找并显示一条记录。7。求全班总成绩的平... 1。输入一个班的学生记录。2。显示所有记录。 3。按学号对所有记录排序4。插入一条学生记录,按学号...
用C语言编写学生信息管理程序(给出五个主要函数就OK啦!)
printf("请输入你要删除的学生学号\n");scanf("%d",&a);for(int i=1;i<=M;i++)if(a==A[i].num){ for(;i<M;i++)A[i]=A[i+1];} } void insert(){ printf("请输入你要输入你要插入的学生学号\n");scanf("%d",&B[1].num);for(int j=1;j<=M;j++)if(B[1]....