#include<stdio.h>
void reverse(char* s,int head,int tail){
while(head<=tail){
char temp=s[head];
s[head]=s[tail];
s[tail]=temp;
head++;
tail--;
}
}
char s[10000]={0};
int main(){
int k=0;
scanf("%d",&k);
scanf("%s",s);
int ns=0;
while(s[ns]!=0) ns++;
reverse(s,0,ns-1);
reverse(s,0,k-1);
reverse(s,k,ns-1);
printf("%s",s);
return 0;
}
结果: