fork download
  1. #include<iostream>
  2. #include<string>
  3. using namespace std;
  4. class DoubleE
  5. {
  6. public:
  7. int i=0,b;
  8. string str;
  9. int count=0;
  10. DoubleE()
  11. {
  12.  
  13. }
  14. void eeWord()
  15. {
  16. cout<<"enter string";
  17. getline (cin,str);
  18.  
  19. b=i;
  20. for(i=0;i<str.length();i++)
  21. {
  22. if(str[i]=='e')
  23. count++;
  24. if(str[i]==' ')
  25. {
  26. if(count>=2)
  27. {
  28. for(int j=b+1;j<i;j++)
  29. {
  30. cout<<str[j];
  31. }
  32. cout<<endl;
  33. break;
  34. }
  35. b = i;
  36. count=0;
  37. }
  38. }
  39. }
  40. };
  41. int main()
  42. {
  43. DoubleE d= DoubleE();
  44. d.eeWord();
  45. return 0;
  46. }
Success #stdin #stdout 0s 15240KB
stdin
Feet and breed
stdout
enter stringeet