亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

C語言實(shí)現(xiàn)學(xué)生籍貫信息記錄簿

 更新時(shí)間:2022年06月02日 11:18:42   作者:普通學(xué)長(zhǎng)  
這篇文章主要為大家詳細(xì)介紹了C語言實(shí)現(xiàn)學(xué)生籍貫信息記錄簿,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下

本文實(shí)例為大家分享了C語言實(shí)現(xiàn)學(xué)生籍貫信息記錄簿的具體代碼,供大家參考,具體內(nèi)容如下

一、任務(wù)概述(文章僅供參考)

進(jìn)一步掌握和利用C語言進(jìn)行課程設(shè)計(jì)的能力;
進(jìn)一步理解和運(yùn)用結(jié)構(gòu)化程序設(shè)計(jì)的思想和方法;
初步掌握開發(fā)一個(gè)小型實(shí)用系統(tǒng)的基本方法;

二、設(shè)計(jì)功能

1.創(chuàng)建信息鏈表并以磁盤文件保存;
2.讀取磁盤文件并顯示輸出所有學(xué)生的籍貫信息;
3.按學(xué)號(hào)或姓名查詢其籍貫;
4.按籍貫查詢并輸出該籍貫的所有學(xué)生;
5.能添加、刪除和修改學(xué)生的籍貫信息

三、功能展示

四、思維導(dǎo)圖

五、程序源碼

#include "dos.h"
#include "stdio.h"
#include "stdlib.h"
#include "conio.h"
#include "math.h"
#include "string.h"?
/**********************建立鏈表******************************/
struct hj ??
{ long number;
? char name[10],address[50];
? struct hj *next;
};
/********************文件操作函數(shù)******************************/
FILE *fp;
void openfile(char xx[20])
{
?
?fp=fopen(xx,"ab+");
?if(fp==NULL)
? ? fp=fopen(xx,"wb");
}
/**************錄入信息函數(shù)***********************************/
void hjnew(void)?
{
?system("cls");
?int n=0;
?long xnumber;
?char xname[10];
?char xaddress[50];
?struct hj *head;
?struct hj *x1,*x2;
?head=NULL;
?x2=NULL;
?printf("\n ? ? ? ? ? ? ? ?★★★★★歡迎使用戶籍管理系統(tǒng)★★★★★\n");
?printf("\n ? ? ? ? ? ? ? ? ? ? ? ? ?★★★錄入信息★★★\n");
?printf("\n ? ? ? ? ? ? ? ? ? ? ? ?〓提示輸入0返回上級(jí)菜單〓\n\n\n");
?printf("\n ? ? ? ? ? ? ? ? ? ? ? ? 請(qǐng)輸入學(xué)號(hào)【15字內(nèi)】:");
?scanf("%ld",&xnumber);
?if(xnumber==0)
? goto haha;
?printf("\n ? ? ? ? ? ? ? ? ? ? ? ? 請(qǐng)輸入姓名【10字內(nèi)】:");
?scanf("%s",xname);
?printf("\n ? ? ? ? ? ? ? ? ? ? ? ? 請(qǐng)輸入籍貫【25字內(nèi)】:");
?scanf("%s",xaddress);
? ? while(xnumber!=0)
?{
? n++;
? x1=(struct hj *)malloc(sizeof(struct hj));
? x1->number=xnumber;?
? strcpy(x1->name,xname);
? strcpy(x1->address,xaddress);
? if(n==1)
? ?head=x1;
? else
? ?x2->next=x1;
? ? ?x2=x1;
?printf("\n ? ? ? ? ? ? ? ? ? ? ? ? 請(qǐng)輸入學(xué)號(hào)【15字內(nèi)】:");
?scanf("%ld",&xnumber);
?if(xnumber==0)
? break;
?printf("\n ? ? ? ? ? ? ? ? ? ? ? ? 請(qǐng)輸入姓名【10字內(nèi)】:");
?scanf("%s",xname);
?printf("\n ? ? ? ? ? ? ? ? ? ? ? ? 請(qǐng)輸入籍貫【25字內(nèi)】:");
?scanf("%s",xaddress);
?}
?x2->next=NULL;
?x1=head;
?while(x1!=NULL)
?{
? openfile("hj.txt");
? char d[5]="山西";
? fwrite(x1,sizeof(struct hj),1,fp);
? fclose(fp);
??
? if(strstr(x1->address,d)!=NULL)
? {?
? ?openfile("schj.txt");
? ?fwrite(x1,sizeof(struct hj),1,fp);
? ?fclose(fp);
? }
? else
? {
? ?openfile("qthj.txt");
? ?fwrite(x1,sizeof(struct hj),1,fp);
? ?fclose(fp);
? }
? x1=x1->next;
?}
?
haha:;
}
/*****************************查詢函數(shù)*************************/
void hjxmselect(void) //按學(xué)號(hào)方式查詢函數(shù)
{
ssmmx:
?int n=0;
?long hh;
?system("cls");
?printf("\n ? ? ? ? ? ? ? ?★★★★★歡迎使用戶籍管理系統(tǒng)★★★★★\n");
?printf("\n ? ? ? ? ? ? ? ? ? ? ? ?★★★查詢編輯信息★★★\n");
?printf("\n ? ? ? ? ? ? ? ? ? ? ? ?〓提示輸入0返回上級(jí)菜單〓\n\n\n");
?printf(" ? ? ? ? ? ? ? ? ? ? ? ? 請(qǐng)您輸入學(xué)號(hào):");
?scanf("%ld",&hh);
?if(hh!=0)
?{?
? struct hj *p;
? struct hj *q=NULL,*head=NULL;
? fp=fopen("hj.txt","rb");
? ? if(fp==NULL)
? {
? ?printf("\n沒有記錄,請(qǐng)輸入記錄然后再查詢!");
? ?getch();
? ?goto jjx;
? }
? while(!feof(fp))
? {
? ?n++;
? ?p=(struct hj *)malloc(sizeof(struct hj));
? ?fread(p,sizeof(struct hj),1,fp);
? ?if(n==1)
? ? head=p;
? ?else
? ? q->next=p;
? ?q=p;

? }
? q->next=NULL;
? p=head;
? while(p!=NULL)
? {
? ?if(p->number==hh)
? ?{ ??
? ? int a;
? ? printf("\n ?結(jié) 果 → ? ? 學(xué)號(hào)=%ld ? 姓名=%s",p->number,p->name);
? ? printf("\n ? ? ? ? ? ? ? 地址=%s",p->address);
? ? printf("\n\n ?操 作 → ? ?⑴更改數(shù)據(jù) ?⑵刪除數(shù)據(jù) ?⑶查詢其他數(shù)據(jù) ?⑷返回上頁 ?⑸退出程序\n\n ?請(qǐng)您選擇操作:");
ssmx:
? ? scanf("%d",&a);
? ? switch(a)
? ? {?
? ? ?void hjedit(struct hj *headd,struct hj *pp);
? ? ?void hjdelete(struct hj *headdd,struct hj *ss);
? ? ?case 1: hjedit(head,p);
? ? ? ?goto ssmmx;break;
? ? ?case 2: hjdelete(head,p);
? ? ? ?goto ssmmx;break;
? ? ?case 3: goto ssmmx;
? ? ?case 4: goto jjx;
? ? ?case 5:exit(0);
? ? ?default:printf("\n ? ? ? ? ? ? ? ? ? ? ? ?錯(cuò)誤的選擇,請(qǐng)重新選擇:");
? ? ?goto ssmx;
? ? }
? ? ?}
? ?else
? ? p=p->next;
? }
? int iiii=0;
? printf("\n ? ? ? ? ? ? ? ? ? ? ? ? 沒有此記錄 1.重新查詢 2.返回上一頁 3.退出程序!");
? printf("\n ? ? ? ? ? ? ? ? ? ? ? ? 請(qǐng)選擇:");
qqqq:
? scanf("%d",&iiii);
? switch(iiii)
? {
? ?case 1: ?goto ssmmx;
? ?case 2: ?goto jjx;
? ?case 3: ?exit(0);
? ?default: printf("\n ? ? ? ? ? ? ? ? ? ? ? ?錯(cuò)誤的選擇,請(qǐng)重新選擇:");
? ? ?goto qqqq;
? }
? ? ?goto jjx;
?}
jjx:;
}
void hjxhselect(void)//按姓名方式查詢函數(shù)
{
ssmm:
?int n=0;
?char hh[10];
?system("cls");
?printf("\n ? ? ? ? ? ? ? ?★★★★★歡迎使用戶籍管理系統(tǒng)★★★★★\n");
?printf("\n ? ? ? ? ? ? ? ? ? ? ? ?★★★查詢編輯信息★★★\n");
?printf("\n ? ? ? ? ? ? ? ? ? ? ? ?〓提示輸入0返回上級(jí)菜單〓\n\n\n");
?printf(" ? ? ? ? ? ? ? ? ? ? ? ? 請(qǐng)您輸入姓名:");
?scanf("%s",hh);
?if(strcmp(hh,"0")!=0)
?{?
? struct hj *p;
? struct hj *q=NULL,*head=NULL;
? fp=fopen("hj.txt","rb");
? if(fp==NULL)
? {
? ?printf("\n沒有記錄,請(qǐng)輸入記錄然后再查詢!");
? ?getch();
? ?goto jjj;
? }
? while(!feof(fp))
? {
? ?n++;
? ?p=(struct hj *)malloc(sizeof(struct hj));
? ?fread(p,sizeof(struct hj),1,fp);
? ?if(n==1)
? ? head=p;
? ?else
? ? q->next=p;
? ?q=p;
? }
? q->next=NULL;
? p=head;
? ? ? ? while(p!=NULL)
? {
? ?if(strcmp(p->name,hh)==0)
? ?{ ??
? ? int a;
? ? printf("\n ?結(jié) 果 → ? ? 學(xué)號(hào)=%ld ? 姓名=%s ?",p->number,p->name);
? ? printf("\n ? ? ? ? ? ? ? 地址=%s",p->address);
? ? printf("\n\n ?操 作 → ? ?⑴更改數(shù)據(jù) ?⑵刪除數(shù)據(jù) ?⑶查詢其他數(shù)據(jù) ?⑷返回上頁 ?⑸退出程序\n\n ?請(qǐng)您選擇操作:");
ssm:
? ? scanf("%d",&a);
? ? switch(a)
? ? {?
? ? ?void hjedit(struct hj *headd,struct hj *pp);
? ? ?void hjdelete(struct hj *headdd,struct hj *ss);
? ? ?case 1: hjedit(head,p);
? ? ? ?goto ssmm;break;
? ? ?case 2: hjdelete(head,p);
? ? ? ?goto ssmm;break;
? ? ?case 3: goto ssmm;
? ? ?case 4: goto jjj;
? ? ?case 5:exit(0);
? ? ?default:printf("\n ? ? ? ? ? ? ? ? ? ? ? ?錯(cuò)誤的選擇,請(qǐng)重新選擇:");
? ? ?goto ssm;
? ? }
? ? ?}
? ?else
? ? p=p->next;
? }
? int iii=0;
? printf("\n ? ? ? ? ? ? ? ? ? ? ? ? 沒有此記錄 1.重新查詢 2.返回上一頁 3.退出程序!");
? printf("\n ? ? ? ? ? ? ? ? ? ? ? ? 請(qǐng)選擇:");
qqq:
? scanf("%d",&iii);
? switch(iii)
? {
? ?case 1: ?goto ssmm;
? ?case 2: ?goto jjj;
? ?case 3: ?exit(0);
? ?default: printf("\n ? ? ? ? ? ? ? ? ? ? ? ?錯(cuò)誤的選擇,請(qǐng)重新選擇:");
? ? ?goto qqq;
? }
? ? ?goto jjj;
?}
jjj: ?;
}
void hjjgselect(void)//按籍貫方式查詢
{
yyy:?
?int i;
? ? system("cls");
?printf("\n ? ? ? ? ? ? ? ?★★★★★歡迎使用戶籍管理系統(tǒng)★★★★★\n");
?printf("\n ? ? ? ? ? ? ? ? ? ? ?★★★籍貫方式查詢信息★★★\n\n\n");
?printf("\n ? ? ? ? ? ? ? ? ? ? ? ? 一 ?顯示所有信息\n");
?printf("\n ? ? ? ? ? ? ? ? ? ? ? ? 二 ?顯示山西籍所有信息\n");
?printf("\n ? ? ? ? ? ? ? ? ? ? ? ? 三 ?顯示其它籍所有信息\n");
?printf("\n ? ? ? ? ? ? ? ? ? ? ? ? 四 ?自定義查詢信息\n");
?printf("\n ? ? ? ? ? ? ? ? ? ? ? ? 五 ?←返回上級(jí)菜單\n");
?printf("\n ? ? ? ? ? ? ? ? ? ? ? ? 六 ?↓退出程序\n");
?printf("\n\n ? ? ? ? ? ? ? ? ? ? ? ? ?請(qǐng)選擇:");
?scanf("%d",&i);
?switch(i)
?{ void zdyselect(void);
? void allselect(char a[8]);
? case 1:allselect("hj.txt");
? ? ? ?goto yyy;break;
? case 2: allselect("schj.txt");
? ? goto yyy;break;
? case 3: allselect("qthj.txt");
? ? goto yyy;break;
? case 4: zdyselect();
? case 5: break;
? case 6: exit(0);
?}
}
void zdyselect(void)
{?
ssmmz:
?int n=0,j=0;
?char hh[10];
?system("cls");
?printf("\n ? ? ? ? ? ? ? ?★★★★★歡迎使用戶籍管理系統(tǒng)★★★★★\n");
?printf("\n ? ? ? ? ? ? ? ? ? ? ? ?★★★自定義查詢信息★★★\n\n\n");
?printf(" ? ? ? ? ? ? ? ? ? ? ? ? 請(qǐng)您輸入地址關(guān)鍵字:");
? ? scanf("%s",hh);
?if(strcmp(hh,"0")!=0)
?{?
? struct hj *p;
? struct hj *q=NULL,*head=NULL;
? fp=fopen("hj.txt","rb");
??
? if(fp==NULL)
? {
? ?printf("\n ? ? ? 沒有記錄,請(qǐng)輸入記錄然后再查詢!");
? ?getch();
? ?goto jjz;
? }
? while(!feof(fp))
? {
? ?n++;
? ?p=(struct hj *)malloc(sizeof(struct hj));
? ?fread(p,sizeof(struct hj),1,fp);
? ?if(n==1)
? ? head=p;
? ?else
? ? q->next=p;
? ?q=p;
? }
? q->next=NULL;
? p=head;

? while(p!=NULL)
? {
? ?
? ?if(strstr(p->address,hh)!=NULL)
? ?{ ??
? ??
? ? int a;
? ? j++;
? ? printf("\n ?結(jié) 果 → ? ? 學(xué)號(hào)=%ld ? 姓名=%s ?",p->number,p->name);
? ? printf("\n ? ? ? ? ? ? ? 地址=%s",p->address);
? ? printf("\n\n ?操 作 → ? ?⑴更改數(shù)據(jù) ?⑵刪除數(shù)據(jù) ?⑶查詢下一條數(shù)據(jù) ?⑷返回上頁 ?⑸退出程序\n\n ?請(qǐng)您選擇操作:");
ssmz:
? ? scanf("%d",&a);
? ? switch(a)
? ? {?
? ? ?void hjedit(struct hj *headd,struct hj *pp);
? ? ?void hjdelete(struct hj *headdd,struct hj *ss);
? ? ?case 1: hjedit(head,p);
? ? ? ?goto ssmmz;break;
? ? ?case 2: hjdelete(head,p);
? ? ? ?goto ssmmz;break;
? ? ?case 3: p=p->next;continue;
? ? ?case 4: goto jjz;
? ? ?case 5:exit(0);
? ? ?default:printf("\n ? ? ? ? ? ? ? ? ? ? ? ?錯(cuò)誤的選擇,請(qǐng)重新選擇:");
? ? ?goto ssmz;
? ? }
? ? p=p->next;
? ?}
? ?else
? ? p=p->next;
? }
? if(j==0)
? {
? ?printf("\n\n\n沒有匹配的記錄 按任意鍵繼續(xù)!");
? ?getch();
? ?fclose(fp);
? ?goto ssmmz;
? }
? else
? { int xx;
? ?printf("\n\n查詢完畢! ? ?⑴ ?繼續(xù)查詢 ?⑵ ?返回上一級(jí)菜單 ?⑶ ? 退出程序");
? ?printf("\n請(qǐng)選擇:");
? ?scanf("%d",&xx);
? ?if(xx==2)
? ? goto jjz;
? ?else if(xx==3)
? ? exit(0);
? ??
? }
? goto ssmmz;
jjz: ?;
?}
?
}
void allselect(char a[8])//全部查詢
{
?int n=0;

?int k=0;
?system("cls");
?printf("\n ? ? ? ? ? ? ? ?★★★★★歡迎使用戶籍管理系統(tǒng)★★★★★\n");
?printf("\n ? ? ? ? ? ? ? ? ? ? ? ?★★★籍貫方式信息★★★\n\n\n");
?
? ? struct hj *p;

?struct hj *q=NULL,*head=NULL;
?fp=fopen(a,"rb");
?if(fp==NULL)
?{
? printf("\n對(duì)不起,沒有記錄無法查詢!");
? goto xxxx;
?}
?rewind(fp);
?while(!feof(fp))
?{
? ?n++;
? ?p=(struct hj *)malloc(sizeof(struct hj));
? ?fread(p,sizeof(struct hj),1,fp);
? ?if(n==1)
? ? head=p;
? ?else
? ? q->next=p;
? ?q=p;

?}

?q->next=NULL;
? ? struct hj *h1,*p2,*q3,*r4,*s5;
?h1=p2=(hj *)malloc(sizeof(struct hj));
?p2->next=head;
?
?while(p2->next!=NULL)?
?{?
? q3=p2->next;?
? r4=p2;?
? while(q3->next!=NULL)?
? {?
? ?if(q3->next->number<p2->next->number)?
? ?r4=q3;?
? ?q3=q3->next;?
? }?
? if(r4!=p2)?
? {?
? ?s5=r4->next;?
? ?r4->next=s5->next;?
? ?s5->next=p2->next;?
? ?p2->next=s5;?
? }?
? p2=p2->next;?
?}?
?head=h1->next->next;?
?free(h1);?
? ? p=head;
?while(p!=NULL&&n>0)
?{
? n--;
? printf("\n學(xué)號(hào)=%ld ?姓名=%s",p->number,p->name);
? printf("\n地址=%s",p->address);
? ? ? ? p=p->next;
?}
xxxx:
?printf("\n→顯示完畢←\n⑴ ↑返回上級(jí)菜單 ? ⑵ ↓退出程序 \n請(qǐng) 選 擇 :");
xxx:
?scanf("%d",&n);
?switch(n)
?{
? case 1:break;
? case 2:exit(0);
? default:printf("\n錯(cuò)誤的選擇,請(qǐng)重新選擇:");
? ? goto xxx;
?}
}
void hjselect(void)//查詢編輯信息函數(shù)
{?
cxbegin:
?int a;
?system("cls");
?printf("\n ? ? ? ? ? ? ? ?★★★★★歡迎使用戶籍管理系統(tǒng)★★★★★\n");
?printf("\n ? ? ? ? ? ? ? ? ? ? ? ?★★★查詢編輯信息★★★\n\n\n");
?printf("\n ? ? ? ? ? ? ? ? ? ? ? ? 一 ? ?按學(xué)號(hào)方式查詢\n");
?printf("\n ? ? ? ? ? ? ? ? ? ? ? ? 二 ? ?按姓名方式查詢\n");
?printf("\n ? ? ? ? ? ? ? ? ? ? ? ? 三 ? ?按籍貫方式查詢\n");
?printf("\n ? ? ? ? ? ? ? ? ? ? ? ? 四 ? ?→顯示全部信息\n");
?printf("\n ? ? ? ? ? ? ? ? ? ? ? ? 五 ? ?←返回上級(jí)菜單\n");
?printf("\n ? ? ? ? ? ? ? ? ? ? ? ? 請(qǐng) 選 擇 查 詢 方 式:");
cxmm:
?scanf("%d",&a);
?switch(a)
?{?
? case 1: hjxmselect();goto cxbegin;break;
? case 2: hjxhselect();goto cxbegin;break;
? case 3: hjjgselect();goto cxbegin;break;
? case 4: allselect("hj.txt");goto cxbegin;break;
? case 5: break;
? default:printf("\n錯(cuò)誤的選擇,請(qǐng)重新選擇:");
? ? ? ?goto cxmm;
?}
}
void hjde(void)//刪除界面函數(shù)
{
cxxbegin:
?int a;
?system("cls");
?printf("\n ? ? ? ? ? ? ? ?★★★★★歡迎使用戶籍管理系統(tǒng)★★★★★\n");
?printf("\n ? ? ? ? ? ? ? ? ? ? ? ? ?★★★刪除信息★★★\n\n\n");
?printf("\n ? ? ? ? ? ? ? ? ? ? ? ? 一 ? ?按學(xué)號(hào)方式刪除\n");
?printf("\n ? ? ? ? ? ? ? ? ? ? ? ? 二 ? ?按姓名方式刪除\n");
?printf("\n ? ? ? ? ? ? ? ? ? ? ? ? 三 ? ?按籍貫方式刪除\n");
?printf("\n ? ? ? ? ? ? ? ? ? ? ? ? 四 ? ?→刪除全部信息\n");
?printf("\n ? ? ? ? ? ? ? ? ? ? ? ? 五 ? ?←返回上級(jí)菜單\n");
?printf("\n ? ? ? ? ? ? ? ? ? ? ? ? 請(qǐng) 選 擇 刪 除 方 式:");
cxxmm:
?scanf("%d",&a);
?int i=0;
?switch(a)
?{?
? case 1: hjxmselect();goto cxxbegin;break;
? case 2: hjxhselect();goto cxxbegin;break;
? case 3: zdyselect();goto cxxbegin;break;
? case 4: ?
? ? ?fp=fopen("hj.txt","wb");
? ? ?if(fp!=NULL)
? ? ? i++;
? ? ?fp=fopen("schj.txt","wb");
? ? ?if(fp!=NULL)
? ? ? i++;
? ? ?fp=fopen("qthj.txt","wb");
? ? ?if(fp!=NULL)
? ? ? i++;
? ? ?if(i==3)
? ? ?{
? ? ? printf("\n ? ? ? ? ? ? ? ? ? ? ? ? 全部數(shù)據(jù)已經(jīng)刪除!!!!!!敲任意鍵繼續(xù)");
? ? ? getch();
? ? ?}
? ? ?goto cxxbegin;break;
? case 5: break;
? default:printf("\n錯(cuò)誤的選擇,請(qǐng)重新選擇:");
? ? ? ?goto cxxmm;
?}
}
//==============刪除函數(shù)接口===============
void hjdelete(struct hj *headdd,struct hj *ss)
{
?struct hj *q;
?char d[5]="山西";
?if(headdd==ss)
?{
? headdd=headdd->next;
? goto gogo;
?}
?q=headdd;
?while(q!=NULL)
?{
? if(q->next->number==ss->number)
? {?
? ? ? ? ? ? ?break;
? }
? q=q->next;
?}
? ? q->next=ss->next;
gogo:
?q=headdd;
? ? fp=fopen("hj.txt","wb");
?while(q!=NULL)
?{
??
? fwrite(q,sizeof(struct hj),1,fp);
? q=q->next;
?}
?fclose(fp);
?q=headdd;
?fp=fopen("schj.txt","wb");
?while(q!=NULL)
? ? {
? if(strstr(q->address,d)!=NULL)
? {?
? ?fwrite(q,sizeof(struct hj),1,fp);
? }
? q=q->next;
?}
?fclose(fp);
?q=headdd;
?fp=fopen("qthj.txt","wb");
?while(q!=NULL)
? ? {
? if(strstr(q->address,d)==NULL)
? {?
? ?fwrite(q,sizeof(struct hj),1,fp);
? }
? q=q->next;
?}
?fclose(fp);

}
//===============編輯函數(shù)接口==============
void hjedit(struct hj *headd,struct hj *pp)
{
?int n=0;
?struct hj *p,*p1,*p2;
?char d[5]="江蘇";
?printf("\n ?輸 入 → ? ?學(xué)號(hào)=");
?scanf("%ld",&pp->number);
?printf("\n ? ? ? ? ? ? ?姓名=");
?scanf("%s",pp->name);
?printf("\n ? ? ? ? ? ? ?地址=");
?scanf("%s",pp->address);
?p=headd;
?fp=fopen("hj.txt","wb");
?while(p!=NULL)
?{
??
? fwrite(p,sizeof(struct hj),1,fp);
? p=p->next;
?}
?fclose(fp);
?p1=headd;
?fp=fopen("schj.txt","wb");
?while(p1!=NULL)
? ? {
? if(strstr(p1->address,d)!=NULL)
? {?

? ?fwrite(p1,sizeof(struct hj),1,fp);
? ? ??
? }
? p1=p1->next;
?}
?fclose(fp);
?p2=headd;
?fp=fopen("qthj.txt","wb");
?while(p2!=NULL)
? ? {
? if(strstr(p2->address,d)==NULL)
? {?
? ?fwrite(p2,sizeof(struct hj),1,fp);
? }
? p2=p2->next;
?}
?fclose(fp);
}
/**************************主函數(shù)***********************/
int main(int argc, char* argv[])
{ ??
begin:?
? ? int t;
?system("cls");
?printf("\n ? ? ? ? ? ? ? ?★★★★★歡迎使用戶籍管理系統(tǒng)★★★★★\n\n\n\n\n");
?printf(" ? ? ? ? ? ? ? ? ? ? ? ?一 錄入學(xué)生籍貫信息\n\n");
?printf(" ? ? ? ? ? ? ? ? ? ? ? ?二 查編學(xué)生籍貫信息\n\n");
?printf(" ? ? ? ? ? ? ? ? ? ? ? ?三 刪除學(xué)生籍貫信息\n\n");
?printf(" ? ? ? ? ? ? ? ? ? ? ? ?四 退出程序\n\n");
?printf(" ? ? ? ? ? ? ? ? ? ? ? ?請(qǐng)您選擇:");
mm:?
?scanf("%d",&t);
?switch(t)
?{?
? case 1: hjnew();break;
? case 2: hjselect();break;
? case 3: hjde();break;
? case 4:exit(0);
? default:printf("\n ? ? ? ? ? ? ? ? ? ? ? ?錯(cuò)誤的選擇,請(qǐng)重新選擇:");
? ? ? ?goto mm;
?}
?goto begin;
? ? return 0;
}?

以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

  • C++ 內(nèi)存分配處理函數(shù)set_new_handler的使用

    C++ 內(nèi)存分配處理函數(shù)set_new_handler的使用

    這篇文章主要介紹了C++ 內(nèi)存分配處理函數(shù)set_new_handler的使用,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2020-02-02
  • C++中jsoncpp庫(kù)和nlohmann-json庫(kù)實(shí)現(xiàn)JSON與字符串類型轉(zhuǎn)換

    C++中jsoncpp庫(kù)和nlohmann-json庫(kù)實(shí)現(xiàn)JSON與字符串類型轉(zhuǎn)換

    jsoncpp是ROS自帶的一個(gè)JSON庫(kù),它提供了一些函數(shù)來解析和生成JSON數(shù)據(jù),在ROS中,可以使用jsoncpp庫(kù)來實(shí)現(xiàn)JSON與字符串類型之間的轉(zhuǎn)換,這篇文章主要介紹了jsoncpp庫(kù)和nlohmann-json庫(kù)實(shí)現(xiàn)JSON與字符串類型轉(zhuǎn)換,需要的朋友可以參考下
    2023-08-08
  • C++關(guān)鍵字volatile學(xué)習(xí)筆記

    C++關(guān)鍵字volatile學(xué)習(xí)筆記

    這篇文章主要為大家介紹了C++關(guān)鍵字volatile學(xué)習(xí)筆記,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪
    2023-10-10
  • C++之string類對(duì)象的容量操作詳解

    C++之string類對(duì)象的容量操作詳解

    通過在網(wǎng)站上的資料搜集,得到了很多關(guān)于string類對(duì)象的容量操作,通過對(duì)這些資料的整理和加入一些自己的代碼,希望能夠給你帶來幫助
    2021-08-08
  • C++實(shí)現(xiàn)逆波蘭式

    C++實(shí)現(xiàn)逆波蘭式

    這篇文章主要為大家詳細(xì)介紹了C++實(shí)現(xiàn)逆波蘭式,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2020-11-11
  • 講解C++編程中Address-of運(yùn)算符&的作用及用法

    講解C++編程中Address-of運(yùn)算符&的作用及用法

    這篇文章主要介紹了C++編程中Address-of運(yùn)算符&的作用及用法,是C++入門學(xué)習(xí)中的基礎(chǔ)知識(shí),需要的朋友可以參考下
    2016-01-01
  • 一篇文章帶你了解C語言--數(shù)據(jù)的儲(chǔ)存

    一篇文章帶你了解C語言--數(shù)據(jù)的儲(chǔ)存

    這篇文章主要介紹了C語言數(shù)據(jù)的存儲(chǔ)和取出詳細(xì)講解,作者使用圖文代碼實(shí)例講解,有感興趣的同學(xué)可以學(xué)習(xí)研究下,希望能給你帶來幫助
    2021-08-08
  • C++基于人工智能搜索策略解決農(nóng)夫過河問題示例

    C++基于人工智能搜索策略解決農(nóng)夫過河問題示例

    這篇文章主要介紹了C++基于人工智能搜索策略解決農(nóng)夫過河問題,簡(jiǎn)單描述了農(nóng)夫過河問題的概念、實(shí)現(xiàn)原理并結(jié)合具體實(shí)例形式給出了C++使用人工智能搜索策略解決農(nóng)夫過河問題的相關(guān)操作技巧,需要的朋友可以參考下
    2017-12-12
  • c/c++單例模式類的混合編譯案例詳解

    c/c++單例模式類的混合編譯案例詳解

    ? 由于c語言中沒有類的概念,因此對(duì)于有類的cpp文件與c文件混合編譯時(shí),提供一個(gè)中間層提供類的操作接口,在c文件中調(diào)用接口實(shí)現(xiàn)間接操作類對(duì)象,這篇文章主要介紹了c/c++單例模式類的混合編譯的相關(guān)資料
    2022-10-10
  • c/c++基礎(chǔ)簡(jiǎn)單易懂的快速排序算法

    c/c++基礎(chǔ)簡(jiǎn)單易懂的快速排序算法

    這篇文章主要為大家介紹了c/c++基礎(chǔ)非常簡(jiǎn)單易懂的快速排序算法,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪
    2021-11-11

最新評(píng)論