Мова програмування: C++
Тип програми: Консольна
Написати консольну програму, яка дозволяє користувачеві обрати знак зодіаку та отримати гороскоп на сьогодні та на завтра.
| from typing import Protocol, runtime_checkable | |
| import requests | |
| from random import uniform | |
| @runtime_checkable | |
| class TemperatureSensor(Protocol): | |
| def read_temperature(self) -> float: | |
| """Повертає поточну температуру в градусах Цельсія""" | |
| ... | |
| def get_sensor_id(self) -> str: |
| from .account import BankAccount | |
| __all__ = ['BankAccount'] |
| # треба встановити curl (якщо ще немає) | |
| brew install curl | |
| # якщо немає Homebrew - спочатку треба встановити його: | |
| # /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" | |
| ====================================================================================================================== | |
| #include <iostream> | |
| #include <string> |
| #define WIN32_LEAN_AND_MEAN | |
| #include <iostream> | |
| #include <ws2tcpip.h> | |
| using namespace std; | |
| #pragma comment (lib, "Ws2_32.lib") | |
| #pragma comment (lib, "Mswsock.lib") // AcceptEx(), ConnectEx(), WSASendMsg() тощо | |
| #pragma comment (lib, "AdvApi32.lib") // Security API, Registry API, Service Control Manager тощо |
| #include <iostream> | |
| #include <string> | |
| #include <curl/curl.h> | |
| using namespace std; | |
| size_t write_data(void* ptr, size_t size, size_t nmemb, FILE* stream) { | |
| return fwrite(ptr, size, nmemb, stream); | |
| } |
| #include <iostream> | |
| #include <string> | |
| #include <cstring> | |
| #include <sys/socket.h> | |
| #include <netdb.h> | |
| #include <unistd.h> | |
| using namespace std; | |
| int main() { | |
| string url = "google.com"; |
| build.gradle.kts (Project): | |
| plugins { | |
| alias(libs.plugins.android.application) apply false | |
| kotlin("plugin.compose") version "2.0.21" apply false // !!! | |
| } | |
| ================================================================================================================== | |
| build.gradle.kts (Module:app): |
| #define WIN32_LEAN_AND_MEAN | |
| #include <ws2tcpip.h> | |
| #include <windows.h> | |
| #include <iostream> | |
| #include <string> | |
| #include <queue> | |
| #include <map> | |
| #include <chrono> | |
| #include <thread> |
| SERVER SIDE: | |
| #include <sys/socket.h> | |
| #include <netinet/in.h> | |
| #include <arpa/inet.h> | |
| #include <unistd.h> | |
| #include <iostream> | |
| #include <vector> | |
| #include <string> | |
| #include <cstring> |