Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main() {
- string str;
- getline(cin, str);
- str[0] = toupper(str[0]);
- for (int i = 1; i < str.length(); i++) {
- if (!isalpha(str[i - 1]) && islower(str[i])) {
- str[i] = toupper(str[i]);
- }
- }
- cout << str << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement