fork(1) download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4. string s;
  5. int t, x, a;
  6. int main()
  7. {
  8. getline(cin, s);
  9. x=s.length();
  10. if(s[0]==' ')
  11. {
  12.  
  13. }
  14. else
  15. {
  16.  
  17. cout << s[0];
  18. }
  19. for (int i=2;i<=x;i++)
  20. {
  21. if (s[i-1]==' '){}
  22. else
  23. {
  24. if (s[i-2]==' ')
  25. {
  26. if((char(s[i-1]<=122))&&(char(s[i-1]>=97)))
  27. {
  28. cout <<char(s[i-1]-32);
  29. }
  30. else
  31. {
  32. cout << s[i-1];
  33. }
  34. }
  35. else
  36. {
  37.  
  38.  
  39. cout << s[i-1];
  40.  
  41. }
  42.  
  43. }
  44. }
  45. return 0;
  46. }
  47.  
Success #stdin #stdout 0s 3472KB
stdin
Dzisiaj jest czwartek,
A jutro bedzie piatek.
stdout
DzisiajJestCzwartek,