⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 xiaohong.cpp

📁 人事管理系统
💻 CPP
字号:

#include<stdlib.h>
#include<string.h>
#include<ctype.h>
#include<stdio.h>
#include "graphics.h"
#include "conio.h"
#include "dos.h"
#define maxworker 100
void list(int i,struct WORKER *prof);
void *buffer;
FILE *al;
FILE *fp;
struct date1{
  int year;
  int month;
  int day;
};
struct address {
  char province[10];
  char city[10];
  char street[20];
};
struct WORKER {
 char name[20];
 enum {male,female}sex;
 struct date1 birthday;
 enum {elesch,middle,high,university,other}rofs;
 struct date1 workday;
 int workeri;
 char position[20];
 struct address addr;
 int workerj;
 char tel[13];
 };
void list(int i,struct WORKER *prof){
int j;
char temp[20];
if(i==0){printf("There is no profile in the list!\nPress any key to return!\n");getch();return;}
printf("========There are %d workers' profiles========\n\n",i);
 for(j=0;j<i;j++){
  printf("NO. %d worker's profile=>\n",(j+1));
 printf("\n\tName: %s\n",prof[j].name);
 if(prof[j].sex)
   strcpy(temp,"Female");
 else
   strcpy(temp,"Male");
 printf("\tGender:%s\n",temp);
 printf("\tBirthday:");
   printf("%4d %2d %2d\n",prof[j].birthday.year,prof[j].birthday.month,prof[j].birthday.day);
 printf("\tWorkday:");
   printf("%4d %2d %2d\n",prof[j].workday.year,prof[j].workday.month,prof[j].workday.day);
 switch(prof[j].rofs){
  case 0:
   strcpy(temp,"Element school");
   break;
  case 1:
   strcpy(temp,"Middle school");
   break;
  case 2:
   strcpy(temp,"High school");
   break;
  case 3:
   strcpy(temp,"University");
   break;
  case 4:
   strcpy(temp,"Other");
   break;
  default:
  strcpy(temp,"Error");
 }
 printf("\tThe record of formal schooling:%s\n",temp);
 printf("\tPosition:%s\n",prof[j].position);
 printf("\tAddress:%s %s city %s province\n",prof[j].addr.street,prof[j].addr.city,prof[j].addr.province);
 printf("\tTelephone number:%s\n",prof[j].tel);
 getch();
 }
}
 main()
{
 struct WORKER profile[maxworker];
 void list(int i,struct WORKER *prof);
  int selection,i=0;
  char c;
  do
  {
    printf("\n\n\n\n\n");
    printf("\t\t\t~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n");
    printf("\t\t\t*5.List all the profiles\n");
    printf("\t\t\t*0.exit without save\n\n\n");
    printf("\t\t\t~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n");
    printf("\t\t\tPlease input your selection number:");
    scanf("%d",&selection);
    switch(selection)
       {
	  case 1:
	  break;
	  case 2:
	  break;
	  case 3:
	  break;
	  case 4:
	  break;
	  case 5:
	   list(i,profile);
	   break;
	  default:
	  printf("please enter the correct selection!");
	  return 0;
	 }
 }while(1);

}
 
 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -