#include <stdlib.h>
#include <iostream>
using namespace std;
int GetAddressMessage();//获取公交地址消息
void SetAddress();//设置公交地址
void Output();//输出公交地点
void SetMessage(int busmessge);
int NumBusAddress;//公交地点编号:1/2/3/4/5/6/7/8/9
char * c_BusAddress;//地点名
//报站类的实现
int GetAddressMessage()
{
return NumBusAddress;
}
void SetMessage(int busmessge)
{
NumBusAddress = busmessge;
}
void SetAddress()
{
switch (NumBusAddress)
{
case 1:
c_BusAddress = "到了第一个站";
break;
case 2:
c_BusAddress = "到了第二个站";
break;
case 3:
c_BusAddress = "到了第三个站";
break;
case 4:
c_BusAddress = "到了第四个站";
break;
case 5:
c_BusAddress = "到了第五个站";
break;
case 6:
c_BusAddress = "到了第六个站";
break;
}
}
void Output()
{
cout << c_BusAddress << endl;
}
int main()
{
int busmessage = 1;
for (busmessage = 1; busmessage <= 6; busmessage++)
{
SetMessage(busmessage);
SetAddress();
Output();
_sleep(1000);
}
}