Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- char entre[101];
- int main()
- {
- int rotation, n;
- scanf("%d%d", &n, &rotation);
- scanf("%s", entre);
- printf("%c", entre[42]);
- if(rotation >= 0)
- {
- int i = n-rotation;
- for(; i<n; i++)
- printf("%c", entre[i]);
- i = 0;
- for(; i<(n-rotation); i++)
- printf("%c", entre[i]);
- }
- else
- {
- int i = -rotation;
- for(; i<n; i++)
- printf("%c", entre[i]);
- for(i = 0; i<-rotation; i++)
- printf("%c", entre[i]);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement