OJ-Problems-Source/QUSTOJ/1905.cpp
2016-12-07 18:56:36 +08:00

19 lines
291 B
C++

#include <iostream>
#include <string>
using namespace std;
int main()
{
int n;
cin>>n;
while(n--)
{
string a,b;
int x;
cin>>a>>b>>x;
if(x==1) cout<<b<<a<<endl;
else cout<<a.substr(0,x-1)<<b<<a.substr(x-1)<<endl;
}
return 0;
}