Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <sstream>
- #include <string>
- using namespace std;
- int main()
- {
- string inPut;
- getline(cin, inPut);
- istringstream iss (inPut);
- int long_string = inPut.size();
- string word;
- int counter = 0;
- for(int i =0; i < long_string; i++)
- {
- if(inPut[i]== ' ')
- {
- counter++;
- }
- }
- for(int i = 0; i <= counter; i++)
- {
- iss >>word;
- int long_word = word.size();
- for(int j = 0; j <= long_word; j ++)
- {
- if(word[j]== ',')
- {
- word[j+1]= word[j+1] - 32;
- }
- }
- if(word[0]>=97 && word[0]<=122)
- {
- word[0]=word[0]-32;
- }
- cout << word<<" ";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement