Hellko

42

Dec 9th, 2012
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.29 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3. #include <stdlib.h>
  4.  
  5.  
  6. int main() {
  7. int i;
  8. char s[1000];
  9. gets(s);
  10. int max = strlen(s);
  11.  
  12. for(i=0;i<=max;i++)
  13. {
  14. if (s[i]==32 && 97<=s[i+1] && s[i+1]<=122 && i!=0)
  15. s[i+1]=s[i+1]-32;
  16. if (i==0 && 97<=s[i] && s[i]<=122)
  17. s[0]=s[0]-32;
  18. }
  19. puts(s);
  20. }
Advertisement
Add Comment
Please, Sign In to add comment