-
大小: 100KB文件類型: .rar金幣: 2下載: 0 次發(fā)布日期: 2021-05-25
- 語(yǔ)言: C/C++
- 標(biāo)簽:
資源簡(jiǎn)介
C語(yǔ)言大作業(yè),大一的時(shí)候?qū)懙模F(xiàn)在分享給小伙伴們參考以發(fā)揮余熱。
這是學(xué)生考勤管理系統(tǒng),更多請(qǐng)搜索"C語(yǔ)言課程設(shè)計(jì)之".

代碼片段和文件信息
#include“l(fā)inklist.h“
#include
#include
#include
#include
#include
void?delete_node(plinklist?pl?nodeitem*?pn)
{
????pnode?curr?prev;
????if((curr=find_node(pl?pn))!=NULL){
????????for(curr=pl->head?prev=NULL;?curr!=NULL&&!is_equal(&(curr->elem)?pn);?prev=curr?curr=curr->next)
????????????;
????????if(prev==NULL){
????????????pl->head=curr->next;
????????}
????????else{
????????????prev->next=curr->next;
????????}
????????free(curr);
????????curr=NULL;
????????printf(“\n刪除成功!\n“);
????}
????else{
????????printf(“\n未找到該記錄!\n“);
????}
????return;
}
void?read_list(plinklist?pl)
{
????FILE?*fp;
????if((fp=fopen(“records.txt““r+“))==NULL){
????????fp=fopen(“records.txt““w+“);
????}
????nodeitem?n;
????int?i=0;
????fseek(fp?0?0);
????while(fread(&n?sizeof(nodeitem)?1?fp)==1){
????????insert_list(pl?&n);
????????i++;
????}
????fclose(fp);
????//printf(“%d?devices?have?been?entered\n“?i);
????return;
}
bool?save_node(plinklist?pl)
{
????FILE?*fp;
????pnode?p;
????int?i=0;
????p=pl->head;
????if((fp=fopen(“records.txt“?“w“))==NULL){
????????printf(“\nCan‘t?open?file!\n“);
????????return?0;
????}
????fseek(fp?0?0);
????while(p){
????????fwrite(&(p->elem)?sizeof(nodeitem)?1?fp);
????????p=p->next;
????????i++;
????}
????fclose(fp);
????//printf(“\n%d?devices?have?been?saved!\n“?i);
????return?1;
}
pnode?find_node(plinklist?pl?nodeitem?*pn)
{
????pnode?p=pl->head;
????while(p){
????????if(is_equal(pn?&(p->elem))){
????????????return?p;
????????}
????????p=p->next;
????}
????return?NULL;
}
student*?find_student(pstulist?pl?char?name[])
{
????student*?p=pl->head;
????while(p){
????????if(!strcmp(name?p->elem.name)){
????????????return?p;
????????}
????????p=p->next;
????}
????return?NULL;
}
course*?find_course(pcoulist?pl?char?name[])
{
????course*?p=pl->head;
????while(p){
????????if(!strcmp(name?p->elem.name)){
????????????return?p;
????????}
????????p=p->next;
????}
????return?NULL;
}
void?init_list(plinklist?pl)
{
pl->head=NULL;
return;
}
void?insert_list(plinklist?plnodeitem?*pn)
{
pnode?p=create_node(pn);
p->next=pl->head;
pl->head=p;
return;
}
void?insert_course(pcoulist?pl?cou?*pn)
{
course*?p=create_course(pn);
p->next=pl->head;
pl->head=p;
return;
}
void?insert_student(pstulist?pl?stu?*pn)
{
student*?p=create_student(pn);
p->next=pl->head;
pl->head=p;
return;
}
void?display_list(plinklist?pl)
{
pnode?p=pl->head;
if(p==NULL){
????????printf(“\n暫無(wú)記錄!\n“);
????????return;
}
????printf(“\n缺課日期\t第幾節(jié)課\t課程名稱\t\t學(xué)生姓名\t缺課類型\n\n“);
while(p)
{
display_nodeitem(&(p->elem));
p=p->next;
}
return;
}
void?display_stulist(pstulist?pl)
{
student*?p=pl->head;
????printf(“\n學(xué)生姓名\t曠課次數(shù)\n\n“);
while(p){
printf(“%s\t\t%d\n“?p->elem.name?p->elem.number);
p=p->next;
}
ret
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件??????????8??2017-06-24?22:42??學(xué)生考勤管理系統(tǒng)\password.txt
?????文件????????142??2017-06-24?22:42??學(xué)生考勤管理系統(tǒng)\records.txt
?????文件????????280??2017-06-13?22:57??學(xué)生考勤管理系統(tǒng)\使用說(shuō)明及成員名單.txt
?????文件???????4983??2017-06-13?22:51??學(xué)生考勤管理系統(tǒng)\源代碼\li
?????文件???????6484??2017-06-13?22:51??學(xué)生考勤管理系統(tǒng)\源代碼\li
?????文件???????1103??2017-06-13?22:41??學(xué)生考勤管理系統(tǒng)\源代碼\li
?????文件???????3567??2017-06-13?22:39??學(xué)生考勤管理系統(tǒng)\源代碼\main.cpp
?????文件???????4993??2017-06-13?22:41??學(xué)生考勤管理系統(tǒng)\源代碼\main.o
?????文件???????1412??2017-06-13?22:51??學(xué)生考勤管理系統(tǒng)\源代碼\Makefile.win
?????文件????????719??2017-06-13?21:42??學(xué)生考勤管理系統(tǒng)\源代碼\node.cpp
?????文件????????396??2017-06-13?21:42??學(xué)生考勤管理系統(tǒng)\源代碼\node.h
?????文件???????1541??2017-06-13?21:42??學(xué)生考勤管理系統(tǒng)\源代碼\node.o
?????文件???????2135??2017-06-13?22:16??學(xué)生考勤管理系統(tǒng)\源代碼\nodeitem.cpp
?????文件????????620??2017-06-13?21:42??學(xué)生考勤管理系統(tǒng)\源代碼\nodeitem.h
?????文件???????3215??2017-06-13?22:17??學(xué)生考勤管理系統(tǒng)\源代碼\nodeitem.o
?????文件??????????8??2017-06-13?22:52??學(xué)生考勤管理系統(tǒng)\源代碼\password.txt
?????文件?????????71??2017-06-13?22:52??學(xué)生考勤管理系統(tǒng)\源代碼\records.txt
?????文件???????4809??2017-06-13?21:42??學(xué)生考勤管理系統(tǒng)\源代碼\sort.cpp
?????文件????????212??2017-06-13?21:42??學(xué)生考勤管理系統(tǒng)\源代碼\sort.h
?????文件???????5568??2017-06-13?21:42??學(xué)生考勤管理系統(tǒng)\源代碼\sort.o
?????文件???????1854??2017-06-13?21:40??學(xué)生考勤管理系統(tǒng)\源代碼\缺勤登記.dev
?????文件?????148673??2017-06-13?22:51??學(xué)生考勤管理系統(tǒng)\源代碼\缺勤登記.exe
?????文件????????611??2017-06-13?22:56??學(xué)生考勤管理系統(tǒng)\源代碼\缺勤登記.layout
?????文件?????148673??2017-06-13?22:51??學(xué)生考勤管理系統(tǒng)\缺勤登記.exe
?????目錄??????????0??2017-07-15?20:54??學(xué)生考勤管理系統(tǒng)\源代碼
?????目錄??????????0??2017-07-15?20:54??學(xué)生考勤管理系統(tǒng)
-----------?---------??----------?-----??----
???????????????342077????????????????????26
評(píng)論
共有 條評(píng)論