麻烦大神帮我看下我这个C++代码哪里有错?#include #include using namespace std;int main() {string str;string one;cout str;if (str == cout

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/18 00:23:32

麻烦大神帮我看下我这个C++代码哪里有错?#include #include using namespace std;int main() {string str;string one;cout str;if (str == cout
麻烦大神帮我看下我这个C++代码哪里有错?
#include
#include
using namespace std;
int main()
{
string str;
string one;
cout str;
if (str ==
cout

麻烦大神帮我看下我这个C++代码哪里有错?#include #include using namespace std;int main() {string str;string one;cout str;if (str == cout
语法上少了一对括号,你看一下
 
#include <iostream>
#include <string>
using namespace std;
int main() 
{
    string str;
    string one;
    cout << "请输入你好:" << endl;
    cin >> str;
    if (str == "你好") 
 { //少一对括号
        cout <<  "进入二度模式" << endl;
        cout <<  "请选择:" << endl;
        cin >> one;    
        if (one == "进入")
        { 
        cout<<"yes"<<endl;
        } 
        else if (one == "不进入")
        { 
        cout<<"NO"<< endl;
        } 
        else 
         {
             cout<<"错误请重新输入"<<endl; 
             }
 }  //少一对括号   
    else if (str == "a")
    exit(0);
    else
    cout<<"错误请重新输入"<<endl; 
    system("pause");
    return 0;
   }