Dodano zadnie domowe z laboratorii nr. {3,4,5}

This commit is contained in:
Ruslan Trytsetskyi 2024-12-05 16:46:48 +01:00
parent 9b92b583e6
commit 6271f78cb0
7 changed files with 30410 additions and 0 deletions

BIN
.DS_Store vendored

Binary file not shown.

BIN
Lab'y 3/.DS_Store vendored Normal file

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 MiB

13
Lab'y 4/RGBorazCYMN.txt Normal file
View File

@ -0,0 +1,13 @@
Czerwony(255, 0, 0) = (0%, 100%, 100%, 0%)
Zielony(0, 128, 0) = (100%, 0%, 100%, 50%)
Żółty(255, 255, 0) = (0%, 0%, 100%, 0%)
Turkusowy(64, 224, 208) = (70%, 0%, 15%, 10%)
Seledynowy(172, 255, 175) = (30%, 0%, 30%, 0%)
Burgund (128, 0, 32) = (0%, 100%, 75%, 50%)
Ecru(194, 178, 128) = (0%, 10%, 40%, 20%)
Beżowy(245, 245, 220) = (0%, 0%, 10%, 5%)
Akwamaryn(127, 255, 212) = (60%, 0%, 20%, 0%)
Granatowy(0, 0, 128) = (100%, 100%, 0%, 50%)
Szkarłatny(255, 36, 0) = (0%, 90%, 100%, 0%)
Pudrowy róż(255, 182, 193) = (0%, 30%, 20%, 0%)
forma RGB ==> CYMK

69
Lab'y 4/zadania.cpp Normal file
View File

@ -0,0 +1,69 @@
#include <iostream>
#include <string>
#include <unordered_map>
#include <algorithm>
// mapa znakow
std::unordered_map<char, std::string> morseCode = {
{'a', ".-"},
{'ą', ".-.-"},
{'b', "-..."},
{'c', "-.-."},
{'ć', "-.-.."},
{'d', "-.."},
{'e', "."},
{'ę', "..-.."},
{'f', "..-."},
{'g', "--."},
{'h', "...."},
{'i', ".."},
{'j', ".---"},
{'k', "-.-"},
{'l', ".-.."},
{'ł', ".-..-"},
{'m', "--"},
{'n', "-."},
{'ń', "--.--"},
{'o', "---"},
{'ó', "---."},
{'p', ".--."},
{'q', "--.-"},
{'r', ".-."},
{'s', "..."},
{'ś', "...-..."},
{'t', "-"},
{'u', "..-"},
{'v', "...-"},
{'w', ".--"},
{'x', "-..-"},
{'y', "-.--"},
{'z', "--.."},
{'ź', "--..-."},
{'ż', "--..-"}
};
void encode(std::string word) {
std::string output;
for (char ch : word) {
if (morseCode.find(ch) != morseCode.end()) {
output += morseCode[ch] + " "; //koduj
} else if (ch == ' ') {
output += " / "; // odziel slowa
} else {
output += "?"; // nw co to za znak
std::cout << " Uwaga! W twojej wiadomosci pojawily sie nieoczekiwane znaki, uzyj tylko znakow polskiego alfabetu.";
}
}
std::cout << "Kod morse'a: " << output << std::endl;
}
int main() {
std::string input;
std::cout << "Wprowadz slowo do zakodowania: ";
std::getline(std::cin, input);
// zmieniam na male litery
std::transform(input.begin(), input.end(), input.begin(), ::tolower);
// wywolaj i wyswietl w f. void
encode(input);
return 0;
}

BIN
Lab'y 5/20241117_225602.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

30328
Lab'y 5/Zadanie domowe 18.pdf Normal file

File diff suppressed because it is too large Load Diff