This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <string> | |
| #include <cstring> | |
| #include <sys/types.h> | |
| #include <sys/socket.h> | |
| #include <arpa/inet.h> | |
| #include <unistd.h> | |
| #include <signal.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <string> | |
| #include <cstring> | |
| #include <arpa/inet.h> | |
| #include <sys/socket.h> | |
| #include <unistd.h> | |
| int main() { | |
| int clientSocket = socket(AF_INET, SOCK_STREAM, 0); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <vector> | |
| #include <string> | |
| #include <algorithm> | |
| #include <curl/curl.h> | |
| using namespace std; | |
| size_t WriteToString(void* ptr, size_t size, size_t nmemb, void* data) { | |
| ((string*)data)->append((char*)ptr, size * nmemb); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "Cat.h" | |
| void Cat::run(double distance) const { | |
| std::cout << "Кіт " << name << " біжить (" << distance << ")\n"; | |
| } | |
| void Cat::jump(double height) const { | |
| std::cout << "Кіт " << name << " стрибає (" << height << ")\n"; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "LambdaTasks.h" | |
| #include <algorithm> | |
| #include <iostream> | |
| int countEvenInList(const std::list<int>& lst) { | |
| auto lambda = [](int x) { | |
| return x % 2 == 0; | |
| }; | |
| return std::count_if(lst.begin(), lst.end(), lambda); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "VectorTasks.h" | |
| #include <algorithm> | |
| #include <functional> | |
| int FindMin::operator()(const vector<int>& v) const { | |
| return *min_element(v.begin(), v.end()); | |
| } | |
| int FindMax::operator()(const vector<int>& v) const { | |
| return *max_element(v.begin(), v.end()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include "word_counter.h" | |
| using namespace std; | |
| int main() { | |
| WordCounter wc; | |
| wc.readFromFile("input.txt"); | |
| wc.printAll(); | |
| wc.printMostFrequent(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "functions.h" | |
| #include <algorithm> | |
| #include <cmath> | |
| int sumDigits(const vector<int>& arr) { | |
| int sum = 0; | |
| for (int x : arr) { | |
| int t = abs(x); | |
| while (t > 0) { | |
| sum += t % 10; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include "my_unique_ptr.h" | |
| #include "my_shared_ptr.h" | |
| using namespace std; | |
| int main() | |
| { | |
| cout << "=== TEST my_unique_ptr ===" << endl; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "HtmlValidator.h" | |
| #include <fstream> | |
| #include <stack> | |
| #include <string> | |
| #include <cctype> | |
| using namespace std; | |
| bool HtmlValidator::validateFile(const string& path, string& errorMessage) { | |
| ifstream in(path); |
NewerOlder