2000 LSU Computer Science High School Programming Contest
Novice Problem 3: Rotating Words (Judge Copy)

MAIN
  Home
  Schedule
  Rules
  Compile

PROBLEMS
  Novice
  Veteran
  All

  

Return to the Top of Page, 2000 Index Page, Novice Problem Set, or Veteran Problem Set.

Novice Problem 3: Rotating Words (Judge Copy)

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

Return to the Top of Page, 2000 Index Page, Novice Problem Set, or Veteran Problem Set.

Test Data 0

Computer
3
Program
1
Prog
4
#

Return to the Top of Page, 2000 Index Page, Novice Problem Set, or Veteran Problem Set.

Output for Test Data 0

terCompu
mProgra
Prog

Return to the Top of Page, 2000 Index Page, Novice Problem Set, or Veteran Problem Set.

Test Data 1

Can
3
Hello
2
Multiplicity
3
Supermath
4
Abundantperfectanddeficient
6
#

Return to the Top of Page, 2000 Index Page, Novice Problem Set, or Veteran Problem Set.

Output for Test Data 1

Can
loHel
ityMultiplic
mathSuper
icientAbundantperfectanddef

Return to the Top of Page, 2000 Index Page, Novice Problem Set, or Veteran Problem Set.

Test Data 2

orca.st.usm.edu.bisland
3
woofergelimansweetie
7
m&mbrandplain
12
atleastihadabathtoday
5
#

Return to the Top of Page, 2000 Index Page, Novice Problem Set, or Veteran Problem Set.

Output for Test Data 2

andorca.st.usm.edu.bisl
sweetiewoofergeliman
&mbrandplainm
todayatleastihadabath

Return to the Top of Page, 2000 Index Page, Novice Problem Set, or Veteran Problem Set.



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 Fri Feb 11 21:55:29 2000.