Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- void erase_vowels(wstring&);
- int main() {
- wcin.imbue(locale(".866"));
- wcout.imbue(locale(".866"));
- wcout << L"Введите текст на русском языке: ";
- wstring text;
- getline(wcin, text);
- erase_vowels(text);
- wcout << text << endl;
- wcin.sync();
- wcin.get();
- return 0;
- }
- void erase_vowels(wstring& line) {
- const wchar_t *vowels = L"АаЕеЁёИиОоУуЫыЭэЮюЯя";
- wstring::size_type pos = 0;
- while ((pos = line.find_first_of(vowels)) != wstring::npos) line.erase(pos, 1);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement