当前位置:首页 » 编程语言 » c语言考勤系统删除功能描述
扩展阅读
webinf下怎么引入js 2023-08-31 21:54:13
堡垒机怎么打开web 2023-08-31 21:54:11

c语言考勤系统删除功能描述

发布时间: 2023-02-09 01:25:47

1. c语言程序设计学生考勤系统

是位运算,先把a,b转化成二进制,然后位相或,有1出1,无1出0 比如 a=5 b=2 5的二进制表示是101 2的二进制表示是10 那么101|10=111 111十进制表示是7 所以a|b=7 如果a=3 b=2 那么a|b 结果是 11|10=11 a|b=3

2. c语言学生成绩管理系统程序设计,有添加,查找,删除,输出,修改,排序等功能!!!

同学你参照下,有不懂的,网络上Hi我
#include<stdio.h>
#include<stdlib.h>
#include<malloc.h>
#include<string.h>
struct sc
{
int chinese;
int maths;
int english;
};

typedef struct node
{
int num;
char name[20];
struct sc score;
struct node *next;
}st;

int menu()//菜单
{
int choice;
do{
system("cls");
printf("\t1.input the messega about a student\n");

printf("\t2.insect a messega of a new student\n");

printf("\t3.look for the messega\n");

printf("\t4.dellect the messega\n");

printf("\t5.arranging base on the number of learning\n");

printf("\t6.output all the messega\n");

printf("\t7.arranging base on all scores\n");

printf("\t8.exit the system\n");

printf("\tplease input your choice:");

scanf("%d",&choice);
}while(choice>7&&choice<1);
return choice;
}

st *create()//创建链表
{
st *head,*p,*tail;
char c;
head=tail=NULL;
while(c!='n'&&c!='N')
{

p=(st *)malloc(sizeof(st));
p->next=NULL;
printf("\t\tplease input the number of learning:");
scanf("%d",&p->num);

printf("\t\tplease input the name:");
scanf("%s",p->name);

printf("\t\tplease input the score of chinese:");
scanf("%d",&p->score.chinese);

printf("\t\tplease input the score of maths:");
scanf("%d",&p->score.maths);

printf("\t\tplease input the score of english:");
scanf("%d",&p->score.english);
if(head==NULL)

head=tail=p;
else
{
tail->next=p;
tail=p;
}

printf("\t\tcontinue or stop(Y/N):");
scanf("%s",&c);
}
return head;
}

st *arrange(st *head)// 以学号排名
{
st *p,*q;
int t,i=1,j,chinese,maths,english;
char name[20];
p=head;
if(head==NULL)
printf("\t\tNoting to arrange\n");
else
{
do
{
j=1;
while(p->next!=NULL)
{
q=p->next;
if(p->num>=q->num)
{
t=p->num;
p->num=q->num;
q->num=t;

strcpy(name,p->name);
strcpy(p->name,q->name);
strcpy(q->name,name);

chinese=p->score.chinese;
p->score.chinese=q->score.chinese;
q->score.chinese=chinese;

maths=p->score.maths;
p->score.maths=q->score.maths;
q->score.maths=maths;

english=p->score.english;
p->score.english=q->score.english;
q->score.english=english;

}
p=q;
j++;
}
p=head;
i++;
}while(i!=j);
}
return head;
}

st *arrangeall(st *head)//以总分排名
{
st *p,*q;
int t,i=1,j,chinese,maths,english;
char name[20];
p=head;
if(head==NULL)
printf("\t\tNoting to arrange\n");
else
{
do
{
j=1;
while(p->next!=NULL)
{
q=p->next;
if(p->score.chinese+p->score.maths+p->score.english<q->score.chinese+q->score.maths+q->score.english)
{
t=p->num;
p->num=q->num;
q->num=t;

strcpy(name,p->name);
strcpy(p->name,q->name);
strcpy(q->name,name);

chinese=p->score.chinese;
p->score.chinese=q->score.chinese;
q->score.chinese=chinese;

maths=p->score.maths;
p->score.maths=q->score.maths;
q->score.maths=maths;

english=p->score.english;
p->score.english=q->score.english;
q->score.english=english;

}
p=q;
j++;
}
p=head;
i++;
}while(i!=j);
}
return head;
}

st *insect(st *head,st *t)//插入学生的信息
{
st *p,*q;
p=head;
if(head==NULL)
printf("\tThe list is empty\n");
else
{

if(t->num==p->num)
{
head=t;
t->next=p;
}
else
{
while(p->next!=NULL)
{
q=p->next;
if(p->num<=t->num&&q->num>=t->num)
{
t->next=q;
p->next=t;
}
p=q;
}
p->next=t;
}
}
return head;
}

void output(st *head)//输出所以学生的信息
{
st *p;
int i=0;
float sum1=0,sum2=0,sum3=0;
p=head;
if(head==NULL)
{
printf("\tThere is nothing \n");
return;
}
else
{
printf("\tnumber name chinese maths english allscores\n");
while(p)
{
printf("\t %d ",p->num);
printf(" %s ",p->name);
printf(" %d ",p->score.chinese);
printf(" %d ",p->score.maths);
printf(" %d ",p->score.english);
printf("%6d",p->score.chinese+p->score.maths+p->score.english);
printf("\n");
p=p->next;
}

p=head;
while(p)// avrege scores
{
sum1+= p->score.chinese;
sum2+=p->score.maths;
sum3+=p->score.english;
p=p->next;
i++;
}
printf("\tarvege %.2f %.2f %.2f %.2f \n",sum1/i,sum2/i,sum3/i,(sum1+sum2+sum3)/i);

}
system("pause");
}

st *dellect(st *head,st *d)//删除学生的信息
{
st *p,*q;
char c;
p=head;
if(!(strcmp(p->name,d->name)))
{
head=p->next;
free(p);
}
else
{
while((strcmp(p->name,d->name))&&p->next!=NULL)
{
q=p;
p=q->next;
}
if(!(strcmp(p->name,d->name)))
{
printf("do you want to delete %S ?(Y/N):",p->name);
scanf("%s",&c);

if(c=='y'||c=='Y')
{
q->next=p->next;
free(p);
}
}
else
printf("\tThere isn't this name\n");
}

return head;
}

void find(st *head,st *s)//查找学生的信息
{
st *p,*q;
p=head;
if(head==NULL)
printf("\tThe list is empty\n");
else
{

while((strcmp(p->name,s->name))!=0&&p->next!=NULL)
{

q=p;
p=q->next;
}

if((strcmp(p->name,s->name))==0)

{
printf("\t %d ",p->num);
printf(" %s ",p->name);
printf(" chinese=%d ",p->score.chinese);
printf(" maths=%d ",p->score.maths);
printf(" english=%d ",p->score.english);
printf("all=%d",p->score.chinese+p->score.maths+p->score.english);
printf("\n");
}
else
printf("\tThe name is missing\n");
}
system("pause");
}

void main()//主函数
{
st *head,*t,*s,*d;
int choice;

for(;;)
{
choice=menu();
switch(choice)
{

case 1:
head=create();
break;

case 2:
t=(st *)malloc(sizeof(st));
t->next=NULL;
printf("\t\tplease input the number of learning:");
scanf("%d",&t->num);

printf("\t\tplease input the name:");
scanf("%s",t->name);

printf("\t\tplease input the score of chinese:");
scanf("%d",&t->score.chinese);

printf("\t\tplease input the score of maths:");
scanf("%d",&t->score.maths);

printf("\t\tplease input the score of english:");
scanf("%d",&t->score.english);

head=insect(head,t);
break;

case 4:

d=(st *)malloc(sizeof(st));
d->next=NULL;
printf("\twhice student do you want to dellect?please input the name:");
scanf("%s",d->name);
head=dellect(head,d);
break;

case 3:

s=(st *)malloc(sizeof(st));
s->next=NULL;
printf("\twhice student do you want to look for?please input the name:");
scanf("%s",s->name);
find(head,s);
break;

case 5:
head=arrange(head);//number
break;

case 6:
output(head);
break;
case 7:
head=arrangeall(head);//score
break;

case 8:
printf("\t\tThank you,goodbye\n");
exit(0);
}
}

}

3. 我用C语言写了一个学生管理系统,就是删除功能不知如何编写,想问问如何实现对结构体数组其中的一项清空

很简单。
假设你定义的结构体数组大小为MaxSize=1000,你可以定义一个当前数组中的学生数Size,
该数值随着录入的学生信息的多少而变化。
现在假设数组中有500个学生的信息,也即Size=500;你需要删除其中一个学生的资料。
通过查找你得到这个学生的信息存储在第100号结构中,
那么你将101号的学生的信息覆盖到100号结构中(例如:student[99]=student[100]),再将102号的学生的信息复制到101号结构中,依次复制,直到将500号结构中的学生信息复制到499号结构中。然后改写Size=499。
上面的复制过程可以通过一个for循环来实现,100号之前的结构都不用动。
这样,当前学生结构数组中就少了原来100号结构中的学生信息,也就是删除掉了。

4. 学生考勤管理系统C语言代码

#include "stdio.h"
#include "string.h"
int main()
{
char name[50][8];
int grade[20][4];
int zm=0;
int ze=0;
int zc=0;
int zz=0;
int n;
int i;
printf("Please input the nummber of students:");
scanf("%d",&n);
for(i=0;i<n;i++)
{
printf("Please input the %dth student's name:",i+1);
scanf("%s",&name[i]);
printf("Please input the %dth student's Math score:");
scanf("%d",&grade[i][0]);
printf("Please input the %dth student's English score:");
scanf("%d",&grade[i][1]);
printf("Please input the %dth student's Computer score:");
scanf("%d",&grade[i][2]);
grade[i][3]=grade[i][0]+grade[i][1]+grade[i][2];
}
printf("Name Math Enlish Computer total\n");
for(i=0;i<n;i++)
printf("%s\t%d\t%d\t%d\t %d\t\n",name[i],grade[i][0],grade[i][1],grade[i][2],grade[i][3]);
return 0;

}

5. 如何用c语言文件操作来实现删除文件某段内容功能

C语言删除磁盘文件内容中间一段字符串的方法
假定磁盘文件中连续存放了相同长度的若干段字符串,要删除中间的某一段字符串,剩下的继续保存在文件中。

代码如下,有比较清楚的注释。
//变量定义部分省略
file=fopen(pathname,"rb");//打开磁盘文件,file是文件指针,pathname是磁盘文件的路径和文件名
filedata[0] = (char *)malloc(LENGTH*sizeof(char));//filedata是指针数组用于存放删除后的临时数据,LENGTH是每个字符串的相同长度
//找出要删除的字符串,并将其它的字符串存入临时指针数组
for(found=0,y=0;fread(filedata[y],LENGTH,1,file); )//found用于判断是否找到要删除的字符串
{
*(filedata[y]+LENGTH)='\0';
if(found==0)//没有找到前才进行比较
{
if( strcmp(deldata,filedata[y])==0 )//deldata是要删除的字符串
{
found=1;
//找到要删除的字符串,从临时存放的指针数组中删除
free(filedata[y]);
y--;
}
}
y++;
filedata[y] = (char *)malloc((LENGTH+1)*sizeof(char));
}
free(filedata[y]);//y多加了1,多申请了一段内存空间
fclose(file);
if(found==0)

{
printf("没有找到要删除的字符串。\n");

}

else//将已删除指定字符串后剩余的所有数据从临时存放的指针数组中重新保存到磁盘文件
{
file=fopen(pathname,"wb");
for(m=0;m
{
fwrite(filedata[m],LENGTH,1,file);
free(filedata[m]);//释放内存
}
fclose(file);
}

6. C语言的班级考勤系统

/*学生考勤结构体*/

typedef struct{
int no; //学号
char cl[8]; //班级
char name[8]; //姓名
char sex[3]; //性别
char date[13]; //日期
int flag; //出勤情况
int num; //出勤次数
int scr; //出勤分数
}stu;

/*函数声明*/
int menu();//主目录
void cnum();
Print();

/*定义全局变量*/
stu cla[51]; //只设定1个班,按需要自己设定数组大小

/*主函数*/

main()
{
int flag=1;
while(flag)
{
switch(menu)
case 1:
cnum();
case 2:
Print();
case 0:
flag=0;
}
printf("欢迎下次使用");
getch();
}

int menu() //制作欢迎菜单
{
int n;
printf(" 欢迎登陆考勤系统\n");
printf("1、点名(记录学生出勤情况)\n");
printf("2、查看出勤结果(查看学生出勤得分)\n");
printf("0、退出\n");
printf("请选择:");
scanf("%d",&n);
return n;
}

cnum()
{
int flag=1; //标记
int i=1;
int cl;
printf("请输入上课班级编号:");
scanf("cl");
while(flag)
{
printf("\n开始点名!");
printf("\n请输入来到的同学学号(以0号结束):");//为了方便计算学号跟数组下标一致,零号空去
scanf("%d",&flag);
if(flag!=0)
{
cla[i].no=flag;
cla[i].cl=cl;
·
·
·//输入数据在此省略
printf("输入该同学有没有到(0代表没有到,1代表到):");
scanf("%d",&flag);
·
·
·
}
}
}
Print()
{
//打印所有str里面的信息
}

大概思路是这样,自己看这要求修改吧!因为我都不清楚你的要求

7. C语言成绩管理系统删除信息

voidremove(MESSAGEmessage[]){
inti,j,n,num;
intflag=1;
n=ReadMESSAGEFromFILE(message);
printf("请输入要删除学生的学号:");
scanf("%d",&num);
for(i=0;i<n;i++){
if(num==message[i].number){
for(j=i;j<n-1;++j)
message[i]=message[i+1];
printf("该学生的信息已删除成功! ");
flag=0;
--n;
break;
}
}
if(flag==1)printf("该学生的信息不存在。 ");
WriteAllMESSAGEtoFILE(message,n);
}

8. c语言信息管理系统中删除功能中fseek(fp,a,0);是什么意思 功能是什么求高手帮忙

int fseek( FILE *stream, long offset, int origin );
第一个参数stream为文件指针
第二个参数offset为偏移量,正数表示正向偏移,负数表示负向偏移
第三个参数origin设定从文件的哪里开始偏移
fseek(fp,a,0)就是把文件指针fp从文件头偏移a个字节的位置

9. c语言中删除模块,描述出算法思想

你给的这些信息跟本无法下手啊。。。删除模块最常用的方法就是把原文件中的类容全部读取出来,存在一个结构体或数组中,然后根据条件,删除之后,再写入文件,覆盖原有文件...达到删除的效果..

10. C语言程序设计;学生考勤管理系统

用链表做