Untitled
unknown
plain_text
2 years ago
396 B
11
Indexable
#include <bits/stdc++.h>
using namespace std;
int main()
{
string s;
getline(cin, s);
for(int i=0; i<s.length(); i++) {
if(i == 0 || i == (s.length()-1)) {
s[i] = toupper(s[i]);
}
else if(s[i] == ' ') {
s[i-1] = toupper(s[i-1]);
s[i+1] = toupper(s[i+1]);
}
}
cout<<s<<endl;
return 0;
}Editor is loading...