#include
#include
#include
#define size 2
struct worker_type
worker[size]; int i=0;
void input()
if((fp=fopen("d:\\worker.dat", "w"))==null)
for(i=0;ifread(&worker[i],sizeof(struct worker_type),1,fp);
printf(" %4d%15s%4c%15s%8d%15s%15s\n\n", worker[i].number, worker[i].name, worker[i].***, worker[i].xueli, worker[i].wage, worker[i].address, worker[i].phone_num);}
fclose(fp);
}void find()
for(i=0;i}break;
case 2:
printf("請輸入要查詢職工的姓名:\n");
scanf("%s",name);
if((fp=fopen("d:\\worker.dat", "r"))==null)
for(i=0;i}break;
fclose(fp);break;
default:printf("您輸入的指令有誤!\n");}}
void change()
for(i=0;i
fseek(fp,-sizeof(worker_type),seek_cur);
printf("請輸入修改後的資訊:\n");
printf("\n請輸入職工的姓名:");
scanf("%s",worker[i].name);
printf("\n請輸入職工的編號:");
scanf("%d",&worker[i].number);
printf("\n請輸入職工的學歷:");
scanf("%s",worker[i].xueli);
printf("\n請輸入職工的工資:");
scanf("%d",&worker[i].wage);
printf("\n請輸入職工的性別:");
getchar();
scanf("%c",&worker[i].***);
scanf("%s",worker[i].address);
scanf("%s",worker[i].phone_num);
fwrite(&worker[i],sizeof(struct worker_type),1,fp);
fclose(fp);
}void delate()
for(i=0;i
fclose(fp);
for(i=0;iif(a==worker[i].number)break;
}if((fp=fopen("d:\\worker.dat", "w"))==null)
fclose(fp);
if((fp=fopen("d:\\worker.dat", "w"))==null)
for(i=0;iif(fwrite(&worker[i],sizeof(struct worker_type),1,fp)!=1)
printf("file write error\n");
fclose(fp);
}void menu()
printf(" 返回主選單請按1,結束操作請按0\n");
scanf("%d",&n);
switch(n)
}void main()
課程設計 學生資訊管理系統
煙台大學計算機與控制工程學院 檔名稱 lulu.cpp 完成日期 2015年12月31日 版本號 v1.o 問題描述 學生資訊管理系統 include include include include include xinxi.h using namespace std int main head1...
課程設計 學生資訊管理系統設計
煙台大學計算機與控制工程學院 題目 學生資訊管理系統設計 ifndef head h included define head h included using namespace std typedef struct student elemtype class list 定義結構體,第乙個結構體...
c程式課程設計(學生資訊管理系統)
最近學校在c語言程式設計,選了個學生管理系統,花乙個小時寫了一寫,有的地方寫的不好見諒哈 include include include typedef struct studentstudent student add student root,student tem file f fopen d...