Advertisement
Guest User

Untitled

a guest
Apr 10th, 2020
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.33 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     string input;
  9.     getline(cin, input);
  10.  
  11.     input[0] = toupper(input[0]);
  12.  
  13.     for (int i = 0; i < input.size(); i++)
  14.     {
  15.         if (i == ' ' || i == ',' || i == '-')
  16.         {
  17.             input[i + 1] = toupper(input[i + 1]);
  18.         }
  19.     }
  20.  
  21.     cout << input << endl;
  22.  
  23.     return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement