Отредактируйте код. Если на вход дан 0, пусть программа выводит No documents found, если 1 — One document found. Во всех остальных случаях программа должна, как и прежде, выводить documents found.


sirazeevi: int document_count;
cin >> document_count;
if (1) {
cout << "egual"s << endl;
cout << " One document found" << endl;
} else if (0) {
cout << "not egual"s << endl;
cout << "No documents found" << endl;
}
int a = 5;
cin >> a;
string message = to_string(a) + " documents found"s;
cout << message << endl;
sirazeevi: Помогите!

Ответы

Ответ дал: UBSilver
1

Ответ:

Объяснение:

#include <iostream>

using namespace std;

int main(){

   int document_count;

   cin >> document_count;

   if (document_count==1)

     {

       cout << "egual" << endl;

       cout << " One document found" << endl;

     }

   else if (document_count==0)

     {

       cout << "not egual" << endl;

       cout << "No documents found" << endl;

     }

    else

        cout<<document_count<<" documents found";

return 0;

}

Вас заинтересует