fork download
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5.  
  6. string tekst;
  7. int dlugoscTekstu;
  8.  
  9. int main()
  10. {
  11. while(getline(cin,tekst))
  12. {
  13. dlugoscTekstu=tekst.length();
  14.  
  15. for(int i=0;i<dlugoscTekstu;i++)
  16. {
  17. if(i==0)
  18. {
  19. tekst[0]=toupper(tekst[0]);
  20. }
  21. else if(tekst[i]== ' ')
  22. {
  23. if(i<dlugoscTekstu-1)
  24. {
  25. tekst[i+1]=toupper(tekst[i+1]);
  26. }
  27. }
  28. if(tekst[i]!= ' ')
  29. cout << tekst[i];
  30.  
  31. }
  32. cout << endl;
  33. }
  34.  
  35.  
  36. return 0;
  37. }
  38.  
Success #stdin #stdout 0s 4816KB
stdin
Standard input is empty
stdout
Standard output is empty