Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <ctype.h>
- using namespace std;
- #define NMAX 103
- char s[NMAX];
- int main() {
- cin.getline(s, NMAX);
- for (int i = 0; s[i]; i++) {
- if (isalpha(s[i]) && (!i || s[i - 1] == ' ')) {
- s[i] = toupper(s[i]);
- } else {
- s[i] = tolower(s[i]);
- }
- }
- cout << s << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement