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

📄 yanhan.cpp

📁 人事管理系统
💻 CPP
字号:
#include<string.h>
#include<ctype.h>
#include<stdio.h>
#include<graphics.h>
#include<conio.h>
#include<dos.h>
#define maxworker 100
void *buffer;
FILE *al;
FILE *fp;
struct data1{
 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 data1 birthday;
  enum {elesch,middle,high,university,other}rofs;
  struct data1 workerday;
  int workeri;
  char possition[20];
  struct address addr;
  int workerj;
  char tel[13];
};
void add(int *i,struct WORKER *profile);

enum {false,true}status;

main()
{
  struct WORKER profile[maxworker];
  int *i;
  void add(int *i,struct WORKER *profile);
  int selection;

  do
  {
	printf("\t1.add one worker to the file\n");
	printf("\t6.save new data\n");
	scanf("%d",&selection);
	switch(selection)
	{
		case 1:
			add(i,profile);
			printf("\n\nin function main,i=%d",i);
			break;
		case 6:

			break;
		default:
			printf("please enter the correct selection!\n");
			return 0;
	}
  }while(1);
}

void add(int *i,struct WORKER *profile)
 {
  char add_name[20];
  printf("\n\tNow add NO.%d worker's profile\n",*i+1);
  while(status == false)
   {
    printf("Enter the name of the worker:");
    scanf("%s",add_name);
      if(strlen(add_name)==0||strlen(add_name)>20)
      {
       status=false;puts("input error,name cannot over 8 character or less than 0character!");
       continue;
      }
      else
	status = true;
    }
    strcpy(profile[*i].name,add_name);
    ++(*i);
 }

⌨️ 快捷键说明

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