Advertisement
Guest User

Untitled

a guest
Apr 25th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3. #include <ctype.h>
  4.  
  5. char *str_cpy(char *firts, const char *second)
  6. {
  7. while(*second) *firts++ = *second++;
  8. ++*firts = '\0';
  9. return firts;
  10. }
  11.  
  12. char *str_cat(char *dest, const char *src)
  13. {
  14. char *tmp = dest;
  15.  
  16. while (*dest)
  17. dest++;
  18. while ((*dest++ = *src++) != '\0')
  19. ;
  20. return tmp;
  21. }
  22.  
  23.  
  24. int main()
  25. {
  26. int i;
  27. char str[100];
  28. char temp[100];
  29. printf("Input symbol:\n");
  30. gets(str);
  31. str_cpy(temp, str);
  32. i=0;
  33. while(temp[i])
  34. {
  35. if(isalpha(temp[i]))
  36. {
  37. temp[i]=temp[i]+1;
  38. }
  39. i++;
  40. }
  41. i=0;
  42. while(temp[i])
  43. {
  44. printf("%c",temp[i]);
  45. i++;
  46. }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement