Pascal :
var s:string; t:char; n,i,j,l:longint; begin readln(s); readln(n); l:=length(s); for i:=1 to n do begin t:=s[l]; for j:=l downto 1 do if j<>1 then s[j]:=s[j-1] else s[j]:=t; end; writeln(s); end.
By signing up a 算道OJ universal account, you can submit code and join discussions in all online judging services provided by us.
Using your 算道OJ universal account