人事管理系統c語言
『壹』 求助!!!用c語言編寫一個「員工人事管理系統 」
這個一般的書上都有實例吧,把相關的名稱改改就成了
『貳』 怎麼用C語言寫人事管理系統,要求就是這樣
首先創建一個結構體,如——structstudent{charnum[10];//學號charname[20];//姓名charsex[4];//性別
『叄』 C語言編寫人事管理系統
這個設計不是很復雜,可以嘗試自己做做,
不懂的地方,我幫你解決。me 我,
給你部分代碼,
『肆』 怎樣用c語言來編程一個學校人事管理系統
你這是個作業或者是本科的畢業設計吧?
只用C的話,你要確定程序最終的運行環境.因為主要是用windows的,所以假定你用的windows,這樣的話,你的程序界面就需要用windwos
sdk編程的知識了,因為你用C,所以MFC就沒法用了,那個是C++的.
數據的存儲,你可以採用自己設計存儲文件的方式,也可以使用現有的資料庫,推薦採用sqlLite或者mysql.
如果你的和序序跑在linux下,那可以採用gtk來做界面.
『伍』 C語言人事管理系統
老師布置的作業要自己好好做。知道也不告訴你,讓你干著急哈。
『陸』 c語言 編一個人事管理系統 具有①信息的錄入 ②信息的修改 ③信息的插入 ④信息的刪除:的功能
#include<stdio.h>
#defineN40
#include<string.h>
#include<conio.h>
#include<stdlib.h>
structstudent{
longnum;//工號
charname[10];//姓名
charsex[4];//性別
charad[100];//地址
charbarthday[20];//出生日期
charapartnum[100],posinum[10],adds[100];//部門編號、職務編號、備注
charposiname[20];//職務名稱
floatincome;//職務工資
}st[N];
voidmenu()
{
printf("**************************************** ");
printf("歡迎使用家庭財務管理系統 ");
printf("**************************************** ");
printf("1:添加記錄 ");
printf("2:查詢記錄 ");
printf("3:刪除記錄 ");
printf("4:顯示所有記錄 ");
printf("0:退出 ");
}
voidinput(structstudents[],int*n)
{
printf("請輸入您所要添加的職工數目 ");
intx,i,j,b,flag=0;
scanf("%d",&x);
b=*n+x;
for(i=*n+1;i<=b;i++)
{
flag=1;
printf("請輸入員工工號: ");
scanf("%ld",&s[i].num);
for(j=1;j<i;j++)
if(s[i].num==s[j].num&&i>1)
{printf("輸入有誤 ");flag=0;i--;b--;break;}
if(flag)
{
printf("請輸入員工姓名: ");
scanf("%s",s[i].name);
printf("請依次輸入該員工性別、出生日期、地址、部門編號、職務編號、職務名稱、職務工資、備註: ");
scanf("%s%s%s%s%s%s%f%s",&s[i].sex,&s[i].barthday,&s[i].ad,&s[i].apartnum,&s[i].posinum,&s[i].posiname,&s[i].income,&s[i].adds);
}
}
*n=b;if(flag)printf("添加成功 ");
printf("輸入完畢!按任意鍵返回主菜單!");getch();
}
voidDelete(structstudents[],int*n)
{
printf("請輸入您所要刪除的職工姓名 ");
charm[10];intj;
scanf("%s",m);
for(j=1;j<=*n;j++)
if(strcmp(s[j].name,m)==0)
{
*n=*n-1;
for(;j<=*n;j++)
s[j]=s[j+1];
break;
}
printf("刪除成功! ");
printf("輸入完畢!按任意鍵返回主菜單!");getch();
}
voidfind(structstudents[],intn)
{
longb=0;charc[10],kk[10];
printf(" **************************************** ");
printf(" 1.1----------按工號查詢 ");
printf(" 1.2----------按姓名查詢 ");
printf(" **************************************** ");
intj,e,flag=0;
floatsoc;
scanf("%s",kk);
if(strcmp(kk,"1.1")==0){
printf("請輸入職工工號 ");
scanf("%s",c);
{
for(j=0,e=strlen(c);j<e;j++)
b=b*10+c[j]-48;
printf("工號姓名性別出生日期地址部門編號職務編號職務名稱職務工資備注 ");
for(j=1;j<=n;j++)
if(b==s[j].num)
{
flag=1;
printf("%ld%s%s%s%s%s%s%s%.2f%s",s[j].num,s[j].name,s[j].sex,s[j].barthday,s[j].ad,s[j].apartnum,s[j].posinum,s[j].posiname,s[j].income,s[j].adds);
}
if(!flag)
printf("未找到相關職工信息 ");
}
}
elseif(strcmp(kk,"1.2")==0)
{
printf("請輸入職工姓名 ");
scanf("%s",c);
printf("工號姓名性別出生日期地址部門編號職務編號職務名稱職務工資備注 ");
for(j=1;j<=n;j++)
if(strcmp(s[j].name,c)==0)
{
flag=1;
printf("%ld%s%s%s%s%s%s%s%.2f%s ",s[j].num,s[j].name,s[j].sex,s[j].barthday,s[j].ad,s[j].apartnum,s[j].posinum,s[j].posiname,s[j].income,s[j].adds);
}
if(!flag)
printf("未找到相關職工信息 ");
}
else
printf("輸入有誤..... ");
printf("查找完畢!按任意鍵返回主菜單!");getch();
}
voidprint1(structstudents[],intn)
{
printf("工號姓名性別出生日期地址部門編號職務編號職務名稱職務工資備注 ");
for(;n>0;n--)
printf("%ld%s%s%s%s%s%s%s%.2f%s ",s[n].num,s[n].name,s[n].sex,s[n].barthday,s[n].ad,s[n].apartnum,s[n].posinum,s[n].posiname,s[n].income,s[n].adds);
printf("輸出完畢!按任意鍵返回主菜單!");getch();
}
intmain()
{
menu();
intx,n=0;
while(scanf("%d",&x)!=EOF&&x!=0)
{
switch(x)
{
case1:input(st,&n);break;
case2:find(st,n);break;
case3:Delete(st,&n);break;
case4:print1(st,n);break;
default:printf("Inputerror! ");
}
system("cls");/*清屏*/
menu();
}
return0;
}
『柒』 求一個c語言人事管理系統
不滅王朝
碼齡9年
關注
int menu(){
printf("請按提示輸入完成操作!\n");
printf("1.查詢員工信息\n");
printf("2.統計員工數量\n");
printf("3.錄入員工信息\n");
printf("4.刪除員工信息\n");
printf("5.按id排序所有員工\n");
printf("6.列印所有員工信息\n");
printf("7.退出系統\n");
return 0;
}
如menu()函數所示,該系統一共有7個功能
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct emp{
int id;
char name[50];
struct emp * next;
// struct emp * prev;
};
struct emp * initList();
struct emp * addListTailNode(struct emp * head);
struct emp * deleteListNode(struct emp * head,int id);
struct emp * searchEmp(struct emp * head,int id);
int printList(struct emp * l);
int printNode(struct emp * p);
struct emp * sortList(struct emp * head);
int getListLen(struct emp * head);
int writeToDisk(struct emp * head);
struct emp * readFromDisk();
int menu();
int usage(struct emp * head);
#include "emp.h"
int main(){
struct emp * head;
head=readFromDisk();
usage(head);
return 0;
}
struct emp * initList(){
struct emp * head;
head=(struct emp *)malloc(sizeof(struct emp));
head->next=NULL;
return head;
}
struct emp * addListTailNode(struct emp * head){
int id;
char name[50];
struct emp * p, * last , * check;
last = head;
while(last->next!=NULL){
last=last->next;
}
printf("依次輸入:員工id號,姓名!\n");
scanf("%d%s",&id,&name);
check = head;
while(check!=last){ //遍歷
check=check->next;
if(id==check->id){
printf("添加失敗!員工id號重復!\n");
return head;
}
}
p=(struct emp *)malloc(sizeof(struct emp));
p->id=id;
strcpy(p->name,name);
//
last->next=p;
last=p;
p->next=NULL;
printf("%s員工信息已添加!\n",p->name);
return head;
}
struct emp * deleteListNode(struct emp * head,int id){
struct emp * p,* q;
p = head->next;
while(p!=NULL){
if(p->next->id==id){
break;
}
p=p->next;
}
if(head->next==NULL){
printf("書籍信息為空!刪除失敗!\n");
}
else{
q = p->next;
p->next = q->next;
printf("%s書籍信息被刪除!\n",q->name);
free(q);
}
return head;
}
struct emp * searchEmp(struct emp * head,int id){//查詢,返回節點信息
struct emp * p;
p = head->next;
while(p!=NULL){
if(p->id==id){
break;
}
p=p->next;
}
return p;
}
int printNode(struct emp * p){//列印節點信息
if(p!=NULL){
printf("員工id: %d 員工姓名:%s\n",p->id,p->name);
}
else{
printf("系統內無該員工信息!\n");
}
return 0;
}
int printList(struct emp * head){ //列印整條鏈表
struct emp * p;
p = head->next;
while(p!=NULL){
printNode(p);
p=p->next;
}
return 0;
}
struct emp * sortList(struct emp * head){//排序
struct emp * p,* q;
int temp_id;
char temp_name[50];
for(p=head->next;p!=NULL;p=p->next){
for(q=p->next;q!=NULL;q=q->next){
if(p->id>q->id){
temp_id = q->id;
q->id = p->id;
p->id = temp_id;
//
strcpy(temp_name,q->name);
strcpy(q->name,p->name);
strcpy(p->name,temp_name);
}
}
}
return head;
}
int getListLen(struct emp * head){
int len=0;
struct emp * p;
p=head->next;
while(p!=NULL){
len++;
p=p->next;
}
return len;
}
int writeToDisk(struct emp * head){
FILE * fp;
struct emp * p;
if((fp = fopen("D:\\emp.hhtx", "w")) == 0){
printf("寫入失敗……!\n");
return 0;
}
//
p=head->next;
while(p!=NULL){
fwrite(p,sizeof(struct emp),1,fp);
printf("%d %s\n",p->id,p->name);
p=p->next;
}
fclose(fp);
return 0;
}
struct emp * readFromDisk(){
FILE * fp;
struct emp * head,* last,* p,* temp;
head = initList();
if((fp = fopen("D:\\emp.hhtx", "r")) == 0){
printf("載入失敗……未找到存檔數據!\n\n");
return head;
}
//
last = head;
p=(struct emp *)malloc(sizeof(struct emp));
while(p!=NULL){
p=(struct emp *)malloc(sizeof(struct emp));
fread(p,sizeof(struct emp),1,fp);
printf("讀取數據: %d %s\n",p->id,p->name);
//
last->next=p;
last=p;
p=p->next;
}
fclose(fp);
printf("系統數據初始化完成!");
return head;
}
int menu(){
printf("請按提示輸入完成操作!\n");
printf("1.查詢員工信息\n");
printf("2.統計員工數量\n");
printf("3.錄入員工信息\n");
printf("4.刪除員工信息\n");
printf("5.按id排序所有員工\n");
printf("6.列印所有員工信息\n");
printf("7.退出系統\n");
return 0;
}
int usage(struct emp * head){
int x,id;
struct emp * p;
menu();
while(1){
printf("請輸入序列號:");
scanf("%d",&x);
switch(x){
case 1:
printf("輸入所要查詢的員工的id號:");
scanf("%d",&id);
p = searchEmp(head,id);
printNode(p);
printf("---------------------------------\n");
break;
case 2:
printf("系統中一共存在%d個員工\n",getListLen(head));
break;
case 3:
head=addListTailNode(head);
printf("---------------------------------\n");
break;
case 4:
printf("輸入所要刪除的員工的id號:");
scanf("%d",&id);
head=deleteListNode(head,id);
printf("---------------------------------\n");
break;
case 5:
printf("排序開始……\n");
head=sortList(head);
printf("排序已完成!\n");
printf("---------------------------------\n");
break;
case 6:
printList(head);
printf("------
『捌』 用c語言編寫簡易人事管理系統主要有工人號碼,姓名,出生日期,工資
摘要 #include int n;void draw(int n) { int i,j;for (i=1-(n>>1);i=0) { for (j=0;j<i;j++) printf(" ");for (j=1;j<=2*(n-i)+1;j++) printf(" *");printf(" ");} else { for (j=i;j<0;j++) printf(" ");for (j=1;j<=n+2*i+1;j++) printf(" *");for (j=1;j<=-1-2*i;j++) printf(" ");for...