#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;

int check(string s,int count,char ch){
    int res=0;
    for(int i=0;i<s.length();i++){
        if(s[i]==ch)
            res++;
    }
    if(res>=count)
        return 1;
    else
        return 0;
}

int main() {
  vector<string> v;
  string in;
  while (cin >> in) {
    v.push_back(in);
  }
//   for (auto i : v) {
//     cout << i << "\n";
//   }
  for(int i=0;i<v.size();i++){
      if(check(v[i],1,'e') || check(v[i],3,'a'))
        cout<<v[i]<<"\n";
  }
  return 0;
}

Embed on website

To embed this program on your website, copy the following code and paste it into your website's HTML: