36.右旋字符串
55. 右旋字符串(第八期模拟笔试) (kamacoder.com)
import java.util.Scanner;
public class Main{
static String Change(String s,int k){
int len=s.length();
char[] ch=new char[len];
for(int i=0;i<len-k;i++){
ch[i+k]=s.charAt(i);
}
for(int i=len-k;i<len;i++){
ch[i-len+k]=s.charAt(i);
}
return new String(ch);
}
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
int k=sc.nextInt();
String s=sc.next();
System.out.println(Change(s,k));
sc.close();
}
}
def Change(s,k):
le=len(s)
ch=list()
ch.append(s[le-k:le])
ch.append(s[0:le-k])
return "".join(ch)
k=eval(input(""))
s=input("")
print(Change(s,k))