| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1486 人关注过本帖
标题:求高手解决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
快速回复:求高手解决C++中的 cin cout 为什么重视报错
数据加载中...
 
   



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

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