Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main ()
- {
- string line;
- cout << "Programmed by Kelsey Weissman" << endl << endl;
- cout << "Enter a sentence: ";
- getline(cin, line);
- cout << endl << endl;
- cout << "Your sentence is: " << endl << line << endl << endl
- << "The first letter of each word is:" << endl;
- if (!isspace(line[0]))
- {cout << line[0];}
- for (int i = 0; i < line.length(); i++)
- {
- if (isspace(line[i]) && !isspace(line[i+1]))
- {
- cout << line[i+1];
- }
- }
- cout << endl << endl << "Your original sentence was:" << endl << line << endl << endl;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement