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