This commit is contained in:
s500821 2024-12-06 23:07:21 +01:00
parent e5ab9a08d3
commit a2c5be0236
2 changed files with 242 additions and 0 deletions

219
kodmorsa.cpp Normal file
View File

@ -0,0 +1,219 @@
#include <iostream>
using namespace std;
void kodowanie(char znak){
switch (znak)
{
case 'A':
cout <<"_. ";
break;
case 'a':
cout <<"_. ";
break;
case 'B':
cout <<"_... ";
break;
case 'b':
cout <<"_... ";
break;
case 'C':
cout << "_._. ";
break;
case 'c':
cout << "_._. ";
break;
case 'D':
cout <<"_.. ";
break;
case 'd':
cout <<"_.. ";
break;
case 'E':
cout <<". ";
break;
case 'e':
cout <<". ";
break;
case 'F':
cout << ".._. ";
break;
case 'f':
cout << ".._. ";
break;
case 'G':
cout << "__. ";
break;
case 'g':
cout << "__. ";
break;
case 'H':
cout << ".... ";
break;
case 'h':
cout << ".... ";
break;
case 'I':
cout << ".. ";
break;
case 'i':
cout << ".. ";
break;
case 'J':
cout << ".___ ";
break;
case 'j':
cout << ".___ ";
break;
case 'K':
cout << "_._ ";
break;
case 'k':
cout << "_._ ";
break;
case 'L':
cout <<"._.. ";
break;
case 'l':
cout <<"._.. ";
break;
case 'M':
cout << "__ ";
break;
case 'm':
cout << "__ ";
break;
case 'N':
cout << "_. ";
break;
case 'n':
cout << "_. ";
break;
case 'O':
cout << "___ ";
break;
case 'o':
cout << "___ ";
break;
case 'P':
cout << ".__. ";
break;
case 'p':
cout << ".__. ";
break;
case 'R':
cout << "._. ";
break;
case 'r':
cout << "._. ";
break;
case 'S':
cout << "... ";
break;
case 's':
cout << "... ";
break;
case 'T':
cout <<"- ";
break;
case 't':
cout <<"- ";
break;
case 'U':
cout << ".._ ";
break;
case 'u':
cout << ".._ ";
break;
case 'V':
cout << "..._ ";
break;
case 'v':
cout << "..._ ";
break;
case 'W':
cout << ".__ ";
break;
case 'w':
cout << ".__ ";
break;
case 'X':
cout << "_.._ ";
break;
case 'x':
cout << "_.._ ";
break;
case 'Y':
cout << "_.__ ";
break;
case 'y':
cout << "_.__ ";
break;
case 'Z':
cout << "__.. ";
break;
case 'z':
cout << "__.. ";
break;
default:
cout <<" ";
break;
}
}
int main(){
string napis_wejsciowy;
cout << "Podaj napis: ";
cin >> napis_wejsciowy;
for(char znak: napis_wejsciowy){
kodowanie(znak);
}
}

23
zadanie4.txt Normal file
View File

@ -0,0 +1,23 @@
Czerwony CMYK(0%,100%,100%,0%)
Zielony CMYK(100%,0%,100%,50%)
Żółty CMYK(0%,0%,100%,0%)
Turkusowy CMYK(71%,0%,7%,12%)
Seledynowy CMYK(24%,0%,22%,12%)
Burgund CMYK(0%,98%,99%,62%)
Ecru CMYK(0%,0%,10%,4%)
Beżowy CMYK(0%,14%,35%,15%)
Akwamaryn CMYK((50%,0%,17%,0%)
Granatowy CMYK(100%,100%,0%,50%)
Szkarłatny CMYK(0%,90%,90%,32%)
Pudrowy róż CMYK(0%,15%,9%,5%)