Guest User

CHEFCHR

a guest
Feb 14th, 2018
83
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //CHEFCHR
  2. #include<iostream>
  3. #include<string.h>
  4. #include<algorithm>
  5. using namespace std;
  6. int main()
  7. {
  8. string s;
  9. int t;
  10. cin>>t;
  11. string v;
  12. int count=0;
  13. while(t--)
  14. {
  15. cin>>s;
  16. count=0;
  17. for(int i=0;i<s.length()-3;i++)
  18. {
  19. v=s.substr(i,4);
  20. sort(v.begin(),v.end());
  21. if(v=="cefh")
  22. {
  23. count++;
  24. }
  25. }
  26. if(count==0)
  27. cout<<"normal"<<endl;
  28. else
  29. cout<<"lovely "<<count<<endl;
  30. }
  31. }
RAW Paste Data