Загрузка...

Operator not found

Thread in C/C++ created by Catx_inactive2317854 Oct 11, 2019. 134 views

  1. Catx_inactive2317854
    Catx_inactive2317854 Topic starter Oct 11, 2019 108 Jun 5, 2019
    Вот код:
    Code

    #include <iostream>
    #include <string>

    using namespace std;

    int main()
    {
    string good_pass = "test";
    string user_pass;
    string code = "12345";
    string code_user;
    cout << "Enter Passworld ";
    getline(cin, user_pass);
    if (user_pass == good_pass)
    {
    cout << "Your code: 12345";
    }
    else
    {
    cout << "error" << endl;
    }
    cout << "Enter passworld";
    getline(cin, code_user);
    if (code_user == code);
    {
    cout << "Thanks"


    }

    else {


    cout << "error" << endl;

    }

    return 0;
    }

    в ошибках пишет что второму else нужен if а он есть. что делать?
     
  2. S0baken
    S0baken Oct 11, 2019 Продаю всё, что движется. И не движется тоже 395 Aug 3, 2017
    ; после второго if убери
     
  3. Catx_inactive2317854
    Catx_inactive2317854 Topic starter Oct 11, 2019 108 Jun 5, 2019
    теперь пишет это https://imgur.com/a/l0cWjHj
    The post was merged to previous Oct 11, 2019
    проблему решил
    The post was merged to previous Oct 11, 2019
    спасибо
     
Loading...
Top