Advertisement
chevengur

Вводный курс: основы C++ | Урок 2: Условный оператор if 3/3

Aug 17th, 2023 (edited)
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.42 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7.     int document_count;
  8.     cin >> document_count;
  9.     if (document_count == 0) {
  10.         std::cout << "No documents found";
  11.     }
  12.     else if (document_count == 1) {
  13.         std::cout << "One document found";
  14.     }
  15.     else {
  16.         string message = to_string(document_count) + " documents found"s;
  17.         cout << message << endl;
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement