发表于:2005-11-03 16:29:00
1楼
编好了一个测试骂人帖子的程序,丢了,重新编一个.
Class corporation:public CObject
{
private:
CString m_name;
CString m_address;
int m_reputation;
int m_employee;
public:
void AddReputation(){m_reputation++;}
void SubReputation(){m_reputation--;}
CString GetName(){return m_name;}
int GetReputatuon(){return m_reputation;}
public:
corporation(CString sname);
}
corporation::corporation(CString sname,int employeenum)
{
m_name = sname;
m_employee=employeenum;
m_address = "China";
m_reputation = 0;
}
int main()
{
corporation A("????",10);
login("工控网论坛");
Browser("帖子");
if (A.GetName() == "被骂公司")
{
A.AddReputation();
if (IsYouInTheCorp() == TRUE)
switch (yourrespond)
{
case 笑笑:
sprintf("good,u are a good employee!\n");
sprintf("不错,胸怀远大....\n");
break;
case 气愤:
sprintf("没有通过测试...\n");
break;
case 回帖对骂:
sprintf("你在说谎,你不是公司\s\n",A.GetName());
break;
default:
sprintf("还不回去工作,在这看热闹!..\n");
break;
}
}
printf("为国产自动化事业努力!\n");
}