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