Guest User

Untitled

a guest
Aug 12th, 2019
71
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. string s, t;
  6. int k;
  7.  
  8. int main()
  9. {
  10. while(getline(cin, s))
  11. {
  12. string t;
  13. for(int i=0; i<=s.length(); i++)
  14. {
  15. if(s[i]==' ')
  16. {
  17. while(s[i]==s[i+1])
  18. {
  19. i++;
  20. }
  21. s[i+1] = toupper(s[i+1]);
  22. t+=s[i+1];
  23. i++;
  24. }
  25. else t+=s[i];
  26. }
  27. cout<< t<< endl;
  28. }
  29.  
  30. return 0;
  31. }
RAW Paste Data