标题:求高手解决C++中的 cin cout 为什么重视报错
只看楼主
阳光猪
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2014-3-5
得分:0 
VEmotion.cpp文件



#include "VEmotion.h"

VEmotion::VEmotion()
{
  Relation=STRINGER;
  Rejection=0;
  cout<<"========================================"<<endl;
  cout<<"==========|欢迎来到虚拟感情世界|========"<<endl;
  cout<<"========================================"<<endl<<endl;
}
int VEmotion::event(AMsg pMsg)
{
  switch(Relation)
  {
    case STRINGER;
        if(strcmp(pMsg,"Y")==0||strcmp(pMsg,"y")==0)
        {
          cout<<endl<<"***彼此熟悉了。***"<<endl<<endl;
          Relation=KNOWN;
        }
        else if(strcmp(pMsg,"N")==0||strcmp(pMsg,"n")==0)
            Rejetion++;
        else
        {
          strcpy(pMsg,"Y");
          event(pMsg);
        }
        break;
        case KNOWN;
             if(strcmp(pMsg,"Y")==0||strcmp(pMsg,"y")==0)
        {
          cout<<endl<<"***我们成为朋友了。***"<<endl<<endl;
          Relation=FRIEND;
        }
        else if(strcmp(pMsg,"N")==0||strcmp(pMsg,"n")==0)
            Rejetion++;
        else
        {
          strcpy(pMsg,"Y");
          event(pMsg);
        }
        break;
        case FRIEND
                if(strcmp(pMsg,"Y")==0||strcmp(pMsg,"y")==0)
        {
          cout<<endl<<"***我们相爱了。***"<<endl<<endl;
          Relation=LOVER;
        }
        else if(strcmp(pMsg,"N")==0||strcmp(pMsg,"n")==0)
            Rejetion++;
        else
        {
          strcpy(pMsg,"Y");
          event(pMsg);
        }
        break;
        case LOVER
                if(strcmp(pMsg,"Y")==0||strcmp(pMsg,"y")==0)
        {
          cout<<endl<<"***我们结婚了。***"<<endl<<endl;
          Relation=COUPLE;
        }
        else if(strcmp(pMsg,"N")==0||strcmp(pMsg,"n")==0)
            Rejetion++;
        else
        {
          strcpy(pMsg,"Y");
          event(pMsg);
        }
        break;
        case CUOPLE
                if(strcmp(pMsg,"Y")==0||strcmp(pMsg,"y")==0)
        {
          cout<<endl<<"***离婚吧。***"<<endl<<endl;
          Relation=BYEBYE;
        }
        else if(strcmp(pMsg,"N")==0||strcmp(pMsg,"n")==0)
        {
           cout<<endl<<"***不答应离婚,依然生活在一起***"<<endl<<endl;
        }
        else
        {
          strcpy(pMsg,"Y");
          event(pMsg);
        }
        break;
  }
  return 0;

}
VEmotion::~VEmotion()
{

}
2014-03-06 17:23



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-428074-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.043665 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved