Advertisement
sneyzi

lab8-task2-12

Jun 8th, 2021
905
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.50 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdlib>
  3. #include <ctime>
  4. #include <fstream>
  5. #include<string>
  6. using namespace std;
  7.  
  8. int main()
  9. {
  10.     ifstream fin("input.txt");
  11.     ofstream fout("output.txt");
  12.  
  13.     string word;
  14.  
  15.     if (fin.is_open()) {
  16.         do {
  17.             fin >> word;
  18.             if (std::strchr("aeiouyAEIOUY", word[0]) && std::strchr("aeiouyAEIOUY", word[word.length()-1])) {
  19.                 fout << word << endl;
  20.             }
  21.         } while (!fin.eof());
  22.         fin.close();
  23.     }
  24.     else cout << "sos";
  25.     fout.close();
  26.     system("pause");
  27.     return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement