?? xiaohong.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 + -