Advertisement
cyberjab

Untitled

Mar 30th, 2023
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. #include <iostream>
  2. #include <iomanip>
  3. #include <algorithm>
  4. #include <cmath>
  5. #include <string>
  6. #include <vector>
  7. #include <set>
  8. #include <ctime>
  9. #include <list>
  10. #include <stack>
  11. #include <iterator>
  12. #include <fstream>
  13.  
  14. using namespace std;
  15.  
  16. int check(string a) {
  17. string alfabet = "eyuioa";
  18. int b = 0;
  19. for (int i = 0; i < alfabet.size(); i++) {
  20. if (a[0] == alfabet[i]) b++;
  21. if (a[a.size() - 1] == alfabet[i]) b++;
  22. }
  23. return b;
  24. }
  25.  
  26. int main()
  27. {
  28. string line;
  29. ifstream in("D:\\inp.txt");
  30. ofstream out;
  31. out.open("D:\\outp.txt");
  32. if (in.is_open()) {
  33. while (getline(in, line)) {
  34. if (check(line) == 2) {
  35. cout << line << "\n";
  36. out << line << "\n";
  37. }
  38. }
  39. }
  40. in.close();
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement