Advertisement
mihnea101

Untitled

Dec 15th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.37 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstring>
  3. using namespace std;
  4. int main(){   
  5. char s[256];   
  6. int i,k;   
  7. cin.getline(s,256);   
  8. s[0]=s[0]-32;   
  9. for(i=1;i<strlen(s)-1;i++)       
  10.     if(s[i]!=' ' && (s[i+1]==' ' || s[i-1]==' '))           
  11.     s[i]=s[i]-32;   
  12.     k=strlen(s)-1;   
  13.     s[k]=s[k]-32;   
  14.     cout<<s;   
  15.     return 0;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement