Guest User

Untitled

a guest
Nov 20th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. int main()
  4. {
  5. int i, shift;
  6. char text[25], x;
  7.  
  8. gets(text);
  9. scanf("%d", &shift);
  10.  
  11. for(i=0; text[i]!=''; i++)
  12. {
  13. x=text[i];
  14. if(x>='a'&&x<='z')
  15. {
  16. x=x+shift;
  17. if(x>'z')
  18. {
  19. x=x-'z'+'a'-1;
  20. }
  21. text[i]=x;
  22. }
  23. }
  24. printf("%s", text);
  25. return 0;
  26. }
Add Comment
Please, Sign In to add comment