Skip to content

Instantly share code, notes, and snippets.

#include <iostream>
#include <thread>
#include <string>
#include <cstring>
#include <ctime>
#include <unistd.h>
#include <arpa/inet.h>
#include <sys/socket.h>
using namespace std;
#include <iostream>
#include <sys/socket.h>
#include <netinet/in.h>
#include <unistd.h>
int main() {
int server_fd = socket(AF_INET, SOCK_STREAM, 0);
sockaddr_in address{};
address.sin_family = AF_INET;
#include <iostream>
#include <string>
#include <algorithm>
#include <winsock2.h>
#pragma comment(lib, "ws2_32.lib")
class StringServer {
private:
int port;
@nicolekorch
nicolekorch / gist:793faf38e71c0be2859233c6917eb32b
Created February 27, 2026 13:01
Практика 2 Домашнє завдання з C++ Робота з функціями та масивами
#include <iostream>
using namespace std;
int main() {
int a, b;
cout << "Enter numbers: ";
cin >> a >> b;
cout << "Sum = " << a + b << endl;
#include <iostream>
using namespace std;
/*
Интерфейс Контроллер
*/
class Controller
{
public:
virtual void start() = 0;
#include <iostream>
#include <vector>
#include <string>
#include <cstdlib>
using namespace std;
// Функція для отримання погоди
void showWeather(const string& city) {
string command = "curl -s \"wttr.in/" + city + "?format=3\"";
@startuml
left to right direction
actor "Клиент" as Client
rectangle "Банкомат" {
usecase "Получить деньги" as UC_Main
usecase "Ввести PIN-код" as UC_Pin
#include <iostream>
#include <vector>
#include <string>
using namespace std;
class Obstacle;
class Participant {
protected:
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <numeric>
#include <unordered_map>
int main() {
std::vector<std::vector<int>> matrix = {{1,2,3},{4,5,6},{7,8,9}};
int evenCount2D = std::accumulate(matrix.begin(), matrix.end(), 0,
#include <iostream>
#include <fstream>
#include <stack>
#include <string>
int main() {
std::string path;
std::cin >> path;
std::ifstream file(path);