Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string.h>
- using namespace std;
- int main()
- {
- char a[250];
- int i,k,n;
- cin.get(a,250);
- k=strlen(a);
- a[0]=toupper(a[0]);
- a[k-1]=toupper(a[k-1]);
- for(i=1; i<k-1; i++)
- {
- if(a[i+1]==' ' || a[i-1]==' ')
- a[i]=toupper(a[i]);
- }
- cout<<a;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement