喔 (挖鼻) 弹 ~~~~*
反正没有与论支持你们也会成功 再去争吧
#define CI_FLIGHT_ATTENDANT_NUM 3000 //空服员人数
enum {LONG=0, SHORT};
enum {ATL,CVG,DTW,FLL,HNL,JFK,LAX,MCO,MSP,SFO,SLC,YVR,TPE,
TSA,KHH,RMQ,TNN,MFM,HKG,CAN,CGO,CGQ,CKG,CSX,CTU,CZX,
DLC,FOC,HGH,KMG,KWL,HAK,HFE,NGB,KHN,LJG,NKG,PEK,PVG,
SHA,SHE,SYX,SZX,TAO,URC,WEH,WNZ,WUH,WUX,XIY,XMN,XUZ,
YNT,YNZ,DEL,CJU,CTS,FSZ,FUK,HIJ,KMJ,ICN,ISG,GMP,KIX,
KMI,KOJ,NGO,HND,NRT,OKA,PUS,TAK,TOY,BKK,CEB,CGK,CNX,
DPS,HAN,HKT,KLO,KUL,LAO,MNL,PEN,PNH,RGN,SGN,SIN,SUB,
UTP,VTE,AMS,FCO,FRA,LHR,PRG,VIE,AKL,BNE,CHC,GUM,MEL,ROR,SYD,STANDBY};
int Code_America[12] = {ATL,CVG,DTW,FLL,HNL,JFK,LAX,MCO,MSP,SFO,SLC,YVR};
int Code_Asia[81] = {TPE,TSA,KHH,RMQ,TNN,MFM,HKG,CAN,CGO,CGQ,CKG,CSX,
CTU,CZX,DLC,FOC,HGH,KMG,KWL,HAK,HFE,NGB,KHN,LJG,
NKG,PEK,PVG,SHA,SHE,SYX,SZX,TAO,URC,WEH,WNZ,WUH,
WUX,XIY,XMN,XUZ,YNT,YNZ,DEL,CJU,CTS,FSZ,FUK,HIJ,
KMJ,ICN,ISG,GMP,KIX,KMI,KOJ,NGO,HND,NRT,OKA,PUS,
TAK,TOY,BKK,CEB,CGK,CNX,DPS,HAN,HKT,KLO,KUL,LAO,
MNL,PEN,PNH,RGN,SGN,SIN,SUB,UTP,VTE};
int Code_Europe[6] = {AMS,FCO,FRA,LHR,PRG,VIE};
int Code_Oceania[7] = {AKL,BNE,CHC,GUM,MEL,ROR,SYD};
struct FA_INFO
{
int e_id;
int age;
int salary;
int join_ci_year;
int allowance;
int mission;
};
void ASSIGN_SCHEDULE(FA_INFO &fa, int distance)
{
srand(time(NULL));
if (distance == SHORT)
{
if (fa.age > 30) //主管说体谅高龄工作者
{
int r_m = rand()%2;
if (r_m == 0)
{
fa.mission = Code_Asia[rand()%81];
}
else
{
fa.mission = STAND_BY; //但我觉得是薪水小偷
}
}
else
{
fa.mission = Code_Asia[rand()%81];
}
}
else
{
int r_m = rand()%3; //没调外站费的的飞远一些
if (r_m == 0)
{
fa.mission = Code_America[rand()%12];
}
else if (r_m == 1)
{
fa.mission = Code_Europe[rand()%6];
}
else
{
fa.mission = Code_Oceania[rand()%7];
}
}
}
int _tmain(int argc, _TCHAR* argv[])
{
FA_INFO fa_info[CI_FLIGHT_ATTENDANT_NUM];
// initial database here
// INIT_DB(fa_info); // fix it!! database 同仁还没更新好资料
for (int i=0; i<CI_FLIGHT_ATTENDANT_NUM; i++)
{
if (fa_info[i].allowance > 3) //外站津贴太贵的
{
ASSIGN_SCHEDULE(fa_info[i], SHORT); //那就飞短的
}
else
{
ASSIGN_SCHEDULE(fa_info[i], LONG);
}
}
return 0;
}
空服员常说看班表前就像是机会命运
还真的是呢 ...
亚洲还要再分距离 算了 谁叫薪水都被空服员跟机师拿光了
程式码当然只有猴子的等级 ...