Помогите с решением С++

Приложения:

Ответы

Ответ дал: clinteastwood2
0
//Microsoft (R) C/C++ Optimizing Compiler Version 19.00.23506 for x64

#include <iostream>
#include <string>
#include <fstream>
#include <sstream>

int main()
{
    ifstream             fin("F1.txt");
    ofstream            fout("F2.txt");
    string                 word, line;
    constexpr char  vowels[6] = { 'a', 'e', 'i', 'o', 'u', 'y' };

    while (getline(fin, line)) 
    {
        stringstream ss;
        ss << line;
        while (ss >> word)
        {
            for (size_t i = 0; i < word.size(); ++i) 
            {
                for (size_t j = 0; j < 6; ++j) 
                {
                    if (word[i] == vowels[j])
                    {
                        word.insert(i, "!");
                        ++i;
                        break;
                    }
                }
            }
            fout << word << " ";
        }
        fout << endl;
    }
}
__________________________________
Пример:

hello wordl
and my dear dog
all my friends birds sun

h!ell!o w!ordl
!and m!y d!e!ar d!og
!all m!y fr!i!ends b!irds s!un 
Вас заинтересует