2000 LSU Computer Science High School Programming Contest
Novice Problem 3: Rotating Words

MAIN
  Home
  Schedule
  Rules
  Compile

RESULTS
  Results

PROBLEMS
  Novice
  Veteran
  All

  

You are required to rotate a word a certain amount. For example, to rotate the word Computer by 1 results in rCompute. Rotating it two more times gives you terCompu.

Input

Your input will be pairs of lines. The first line contains the word (which will not have more than 30 letters). The second line contains an integer n, which will be less than the length of the word. You must rotate the word n times. You will stop when you read a single # instead of a word on the first line.

Output

The output will be the rotated word.

Sample Input

Computer
3
Program
1
#

Sample Output

terCompu
mProgra



The statements and opinions included in these pages are those of the LSU Computer Science High School Programming Contest Staff only. Any statements and opinions included in these pages are not those of Louisiana State University or the LSU Board of Supervisors.

© 2000 LSU Computer Science High School Programming Contest

This page last updated 2001/04/05 20:28:54.