fork download
  1. #include <iostream>
  2. #include <string>
  3. #include <stdio.h>
  4. #include <ctype.h>
  5. #include <algorithm>
  6.  
  7. using namespace std;
  8.  
  9. int main()
  10. {
  11. string str;
  12. int i,n;
  13. unsigned char c;
  14. bool t;
  15.  
  16. getline(cin,str);
  17.  
  18.  
  19. n = str.length();
  20. t = false;
  21.  
  22.  
  23. for(i = 0; i < n; i++)
  24. {
  25. c = str[i];
  26. if(c==' ')
  27. {
  28. if(!t)
  29. {
  30. str[i+1] = (toupper(str[i+1]));
  31. }
  32. }
  33. else t = false;
  34. }
  35.  
  36. str.erase(std::remove(str.begin(), str.end(), ' '), str.end());
  37. cout << str << endl;
  38.  
  39. return 0;
  40. }
  41.  
Success #stdin #stdout 0s 4352KB
stdin
Dzisiaj jest czwartek,
A jutro bedzie piatek.
stdout
DzisiajJestCzwartek,