Praktikum_mf

Структуры и классы/Зачем нужны классы/Задание 1

Sep 30th, 2021
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.50 KB | None | 0 0
  1. #include <map>
  2. #include <set>
  3. #include <string>
  4. #include <vector>
  5. #include <iostream>
  6.  
  7. using namespace std;
  8.  
  9. class SearchServer {
  10.     map<string, set<int>> word_to_documents_;
  11.     set<string> stop_words_;
  12. public:
  13.     int GetStopWordsSize() const {
  14.         return stop_words_.size();
  15.     }
  16.    
  17. };
  18.  
  19. int GetStopWordsSize(const SearchServer& server) {
  20.     return server.GetStopWordsSize();
  21. }
  22.  
  23. int main() {
  24.     SearchServer server;
  25.     cout << GetStopWordsSize(server) << endl;
  26.     return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment