fork download
  1. #include<iostream>
  2. #include<string>
  3. #include<algorithm>
  4. #include<cctype>
  5. #include<vector>
  6. #include<iomanip>
  7. using namespace std;
  8.  
  9. int main() {
  10. // your code goes here
  11. int cnt=6;double count=0;
  12.  
  13. vector<int> num;
  14. vector<char*> str;
  15. string tmp,buff,cap,fcap;
  16. cout <<"Enter the word that you want to search"<<"\n";
  17. cin >>tmp;
  18. cout <<"Searching ="<<tmp<<"=\n";
  19. transform(tmp.begin(),tmp.end(),tmp.begin(),::tolower);
  20. cap=tmp;fcap=tmp;
  21. transform(cap.begin(),cap.end(),cap.begin(),::toupper);
  22. buff = ::toupper(tmp[0]);
  23. fcap.erase(0,1);
  24. fcap.insert(0,buff);
  25. cout <<tmp<<" "<<fcap<<" "<<cap<<"\n";
  26. char* ctmp=new char[tmp.size() + 1];
  27. char_traits<char>::copy(ctmp,tmp.c_str(),tmp.size() + 1);
  28. char* ccap=new char[cap.size() + 1];
  29. char_traits<char>::copy(ccap,cap.c_str(),cap.size() + 1);
  30. char* fccap=new char[fcap.size() + 1];
  31. char_traits<char>::copy(fccap,fcap.c_str(),fcap.size() + 1);
  32. cout <<ctmp<<" "<<fccap<<" "<<ccap<<"\n";
  33. str.push_back("Hello");
  34. str.push_back("World");
  35. str.push_back("abc");
  36. str.push_back("Hello");
  37. str.push_back("def");
  38. str.push_back("Hello");
  39.  
  40.  
  41.  
  42. return 0;
  43. }
Success #stdin #stdout 0s 15240KB
stdin
Hello
stdout
Enter the word that you want to search
Searching =Hello=
hello Hello HELLO
hello Hello HELLO