求高手解决C++中的 cin cout 为什么重视报错
#include "VEmotion.h"#include<iostream>
using namespace std;
void main()
{
int index=0;
AMsg pMsg;
AMsg UName;
AMsg questions[10]={"你喜欢跳舞吗玩吗?(y/n)","我想和你交朋友,你愿意吗?(y/n)","亲爱的,你爱我吗?(y/n)","嫁给我吧(y/n)","我们离婚吧(y/n)"}
};
cout<<"输入姓名:";
cin>>UName;
cout<<"今天遇到一个熟悉的陌生人,他对你很感兴趣……"<<endl;
VEmotion sample;
cout<<"嗨!"<<UName<<",";
while(1)
{
cout<<questions[index];
cin>>pMsg;
sample.event(pMsg);
index=sample.getRelation()-1;
if(sample.Rejection()==MAX_BEAR_TIME)
{
cout<<endl<<"***你很讨厌我吗???****"<<endl;
}
if(sample.Relation()==BYEBYE)
{
cout<<endl<<"***对不起,不要流泪****"<<endl;
}
}
}
--------------------Configuration: zhu3_5 - Win32 Debug--------------------
Compiling...
main.cpp
C:\Documents and Settings\zhu3_5\main.cpp(10) : error C2143: syntax error : missing ';' before '}'
C:\Documents and Settings\zhu3_5\main.cpp(11) : error C2143: syntax error : missing ';' before '<<'
C:\Documents and Settings\zhu3_5\main.cpp(11) : error C2501: 'cout' : missing storage-class or type specifiers
C:\Documents and Settings\zhu3_5\main.cpp(11) : error C2371: 'cout' : redefinition; different basic types
c:\program files\microsoft visual studio\vc98\include\ostream.h(139) : see declaration of 'cout'
C:\Documents and Settings\zhu3_5\main.cpp(11) : error C2143: syntax error : missing ';' before '<<'
C:\Documents and Settings\zhu3_5\main.cpp(12) : error C2143: syntax error : missing ';' before '>>'
C:\Documents and Settings\zhu3_5\main.cpp(12) : error C2501: 'cin' : missing storage-class or type specifiers
C:\Documents and Settings\zhu3_5\main.cpp(12) : error C2371: 'cin' : redefinition; different basic types
c:\program files\microsoft visual studio\vc98\include\istream.h(173) : see declaration of 'cin'
C:\Documents and Settings\zhu3_5\main.cpp(12) : error C2143: syntax error : missing ';' before '>>'
C:\Documents and Settings\zhu3_5\main.cpp(13) : error C2143: syntax error : missing ';' before '<<'
C:\Documents and Settings\zhu3_5\main.cpp(13) : error C2501: 'cout' : missing storage-class or type specifiers
C:\Documents and Settings\zhu3_5\main.cpp(13) : error C2371: 'cout' : redefinition; different basic types
c:\program files\microsoft visual studio\vc98\include\ostream.h(139) : see declaration of 'cout'
C:\Documents and Settings\zhu3_5\main.cpp(13) : error C2143: syntax error : missing ';' before '<<'
C:\Documents and Settings\zhu3_5\main.cpp(15) : error C2143: syntax error : missing ';' before '<<'
C:\Documents and Settings\zhu3_5\main.cpp(15) : error C2501: 'cout' : missing storage-class or type specifiers
C:\Documents and Settings\zhu3_5\main.cpp(15) : error C2371: 'cout' : redefinition; different basic types
c:\program files\microsoft visual studio\vc98\include\ostream.h(139) : see declaration of 'cout'
C:\Documents and Settings\zhu3_5\main.cpp(15) : error C2143: syntax error : missing ';' before '<<'
C:\Documents and Settings\zhu3_5\main.cpp(16) : error C2143: syntax error : missing ';' before 'while'
C:\Documents and Settings\zhu3_5\main.cpp(17) : error C2143: syntax error : missing ';' before '{'
C:\Documents and Settings\zhu3_5\main.cpp(17) : error C2447: missing function header (old-style formal list?)
C:\Documents and Settings\zhu3_5\main.cpp(31) : error C2143: syntax error : missing ';' before '}'
C:\Documents and Settings\zhu3_5\main.cpp(31) : error C2143: syntax error : missing ';' before '}'
C:\Documents and Settings\zhu3_5\main.cpp(31) : error C2143: syntax error : missing ';' before '}'