¹¤×ʹÜÀíϵͳԴ´úÂë

if(strlen(temp1)>20) goto retelephone; else

strcpy(telephone,temp1); } else

strcpy(telephone,temp); }

void setage(int temp) {

renumber: if(temp<=18||temp>65)

{ cout<<\ÊäÈë´íÎó£¡ÇëÖØÐÂÊäÈë¡£\\n\ int temp1;

cout<<\Äê Áä:\\t\ cin>>temp1;

if(temp1<=0||temp1>120) goto renumber;

else age=temp1; } else

age=temp; }

void setmonthwages(double temp) {

monthwages=temp; } };

long employee::employees=0;

class technician: public employee//½²Ê¦ÀàµÄ¶¨Òå

{ protected:

static int technicians;//ÓÃÀ´¼ÇÊý½²Ê¦µÄÊýÁ¿ public:

int gettechnicians() {

return technicians; }

void setnumber(char temp[]) {

technicians++;

employee::setnumber(temp); }

void monthly_wages(double temp) { setmonthwages(temp*100); //½²Ê¦µÄ¹¤×ÊΪ¿Î³ÌÁ¿*¿Îʱ¹¤×Ê100ÿ¿Îʱ } };

int technician::technicians=0;

class manager:public employee//¸¨µ¼Ô±ÀàµÄ¶¨Òå {

static int managers;//¸¨µ¼Ô±µÄÊýÁ¿ public:

int getmanagers() { return managers; }

void monthly_wages() {

setmonthwages(5000);//¸¨µ¼Ô±µÄ¹¤×ÊΪÎåǧ¹Ì¶¨ managers++; } };

int manager::managers=0;

class seller:public employee//½ÌÊÚÀàµÄ¶¨Òå { protected:

static double sellroom; static double sellrooms; static int sellers; public:

int getsellers() { return sellers; }

double getsellroom() {

return sellroom; }

double getsellrooms() { return sellrooms; } void setsellroom(double temp) { sellroom=temp;

sellrooms=sellrooms+temp; }

void monthly_wages() { setmonthwages(sellroom*0.04); sellers++; } };

double seller::sellroom=0; double seller::sellrooms=0; int seller::sellers=0;

class sellermanager:public seller //ÐÐÕþÈËÔ±ÀàµÄ¶¨Òå {

static int sellermanagers;//ÐÐÕþÈËÔ±µÄÊýÁ¿ public:

int getsellermanagers() {

return sellermanagers; }

double getsellrooms() { return sellrooms; } void monthly_wages()

{ setmonthwages(sellrooms*0.005+5000);

sellermanagers++; } };

int sellermanager::sellermanagers=0; //¸÷Êý¾ÝÊäÈëµÄÔ­º¯ÊýÉùÃ÷

void inputtechnician(employee&); void inputmanager(employee&); void inputseller(employee&);

void inputsellermanager(employee&);

void compositorall(employee*);//¶ÔËùÓн̹¤µÄ¹¤×ʽµÐòÅÅÁÐ int printfile();//°ÑÎļþÖеÄ×ÊÁÏÏÔʾµ½ÏÔʾÆ÷ÉÏ void outputtofile(employee*);//°Ñ×ÊÁϱ£´æµ½ÎļþÖÐ int main()

{ employee employeeall[EMP]; int i=0;

while(i

{ system(\Ë¢ÐÂÆÁÄ»

cout<<\±¾ÏµÍ³ÄÜ´æÈë\¸ö½Ì¹¤µÄ×ÊÁÏ ***\\n\

cout<<\ *** ÒѾ­ÊäÈëÁË\<<\½Ì¹¤µÄ×ÊÁÏ ****\\n\

cout<<\cout<<\¡¢ÊäÈë½² ʦµÄ×ÊÁÏ; ***\\n\ cout<<\¡¢ÊäÈ븨 µ¼ Ô±µÄ×ÊÁÏ; ***\\n\ cout<<\¡¢ÊäÈë½Ì ÊÚµÄ×ÊÁÏ; ***\\n\ cout<<\¡¢ÊäÈëÐÐÕþÈËÔ±µÄ×ÊÁÏ; ***\\n\ cout<<\¡¢Í˳öÊäÈë! ***\\n\ cout<<\ cout<<\ÇëÑ¡Ôñ:\ char n[5]; cin>>n;

if(strlen(n)==1)

{ switch(n[0]) {

case '1': inputtechnician(employeeall[i]); i++; break;

case '2': inputmanager(employeeall[i]); i++;

break;

case '3': inputseller(employeeall[i]); i++; break;

case '4': inputsellermanager(employeeall[i]); i++; break;

case '5': system(\Ë¢ÐÂÆÁÄ»

compositorall(employeeall);//¶ÔËùÓн̹¤µÄ¹¤×ʽµÐòÅÅÁÐ outputtofile(employeeall);//°Ñ×ÊÁϱ£´æµ½ÎļþÖÐ cout<<\ÊÇ·ñ´òÓ¡×ÊÁÏ£¨y/n£©\ char a[5]; cin>>a;

if(a[0]=='y'||a[0]=='Y')

printfile();//°ÑÎļþÖеÄ×ÊÁÏÏÔʾµ½ÏÔʾÆ÷ÉÏ return 1;

default: cout<<\´íÎó£¡ÇëÖØÐÂÊäÈ룡\\n\ } }

else

cout<<\´íÎó£¡ÇëÖØÐÂÊäÈ룡\\n\ }

compositorall(employeeall);//¶ÔËùÓн̹¤µÄ¹¤×ʽµÐòÅÅÁÐ outputtofile(employeeall);//°Ñ×ÊÁϱ£´æµ½ÎļþÖÐ printfile();//°ÑÎļþÖеÄ×ÊÁÏÏÔʾµ½ÏÔʾÆ÷ÉÏ return 0; }

void inputtechnician(employee &empl) //½Ì¹¤»ù±¾ÐÅÏ¢µÄÊäÈ뺯Êý { technician tech;

cout<<\¡ï¡ï½Ì¹¤×ÊÁÏ£º\\n\ char temp[20];

cout<<\ÐÕ Ãû:\\t\ cin>>temp;

empl.setname(temp); cout<<\½Ì ¹¤ ºÅ:\\t\ cin>>temp;

empl.setnumber(temp); empl.setpost(\½² ʦ\

ÁªÏµ¿Í·þ£º779662525#qq.com(#Ìæ»»Îª@)