2016_8_21
这题要注意,可能会移动多轮,遇到这种情况两种方法:
1、移动步数%总步数
2、loop(-移动步数+总步数)直到>0
ac code
# -*- coding: utf-8 -*-
"""
Spyder Editor
author hanzy
This is a temporary script file.
"""
if __name__ == "__main__" :
num = raw_input().split(' ')
forward = int(num[0])
backward = - int(num[1])
num = raw_input().split(' ')
while backward + forward <= 0 :
backward = backward + forward
for i in range(forward) :
print num[i+backward],