Advertisement
Kazimirko

Основы С++ / Тема 2 / Урок 2. Условный оператор if / Задача 2

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