diff --git a/sem2/ImanakovVP/Game_dinos/Igra_Dinos_only_sources.rar b/sem2/ImanakovVP/Game_dinos/Igra_Dinos_only_sources.rar new file mode 100644 index 00000000..2b8aee4c Binary files /dev/null and b/sem2/ImanakovVP/Game_dinos/Igra_Dinos_only_sources.rar differ diff --git "a/sem2/ImanakovVP/Game_dinos/\320\242\321\203\321\202 \321\201\321\201\321\213\320\273\320\272\320\260 \320\275\320\260 \320\277\320\276\320\273\320\275\321\213\320\271 \320\260\321\200\321\205\320\270\320\262.txt" "b/sem2/ImanakovVP/Game_dinos/\320\242\321\203\321\202 \321\201\321\201\321\213\320\273\320\272\320\260 \320\275\320\260 \320\277\320\276\320\273\320\275\321\213\320\271 \320\260\321\200\321\205\320\270\320\262.txt" new file mode 100644 index 00000000..f6694dfa --- /dev/null +++ "b/sem2/ImanakovVP/Game_dinos/\320\242\321\203\321\202 \321\201\321\201\321\213\320\273\320\272\320\260 \320\275\320\260 \320\277\320\276\320\273\320\275\321\213\320\271 \320\260\321\200\321\205\320\270\320\262.txt" @@ -0,0 +1 @@ +https://drive.google.com/file/d/19XYTTrs0WHnRoT2CblgqIMW5zjDxw8dF/view?usp=sharing diff --git a/sem2/ImanakovVP/minihw1/dz1 b/sem2/ImanakovVP/minihw1/dz1 new file mode 100644 index 00000000..aedc2891 --- /dev/null +++ b/sem2/ImanakovVP/minihw1/dz1 @@ -0,0 +1,43 @@ +#include +#include +#include +#include + +int main() { + setlocale(LC_ALL, "ru"); + + std::cout << "Enter the string first, then the character: " << std::endl; + + std::string stroka_line; + char bukva_char; + + std::getline(std::cin, stroka_line); + std::cin >> bukva_char; + + std::stringstream ss(stroka_line); + std::vector words; + std::string word; + while (ss >> word) { + words.push_back(word); + } + + auto count_and_show_words = [bukva_char](const std::vector& words) { + std::vector filtered_words; + for (const auto& word : words) { + if (!word.empty() && word[0] == bukva_char) { + filtered_words.push_back(word); + } + } + return filtered_words; + }; + + std::vector filtered_words = count_and_show_words(words); + std::cout << "Number of words starting with letter '" << bukva_char << "': " << filtered_words.size() << std::endl; + std::cout << "These are the words: "; + for (const auto& fw : filtered_words) { + std::cout << fw << " "; + } + std::cout << std::endl; + + return 0; +}