Advertisement
edutedu

vr 77

Apr 15th, 2019
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. #include <iostream>
  2. #include <string.h>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. char a[250];
  8. int i,k,n;
  9. cin.get(a,250);
  10. k=strlen(a);
  11. a[0]=toupper(a[0]);
  12. a[k-1]=toupper(a[k-1]);
  13. for(i=1; i<k-1; i++)
  14. {
  15. if(a[i+1]==' ' || a[i-1]==' ')
  16. a[i]=toupper(a[i]);
  17. }
  18. cout<<a;
  19. return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement