#include
#include
using namespace std;
string f(string s)
{
if(s.length()==1) return s;
else return f(s.substr(1))+s.substr(0,1);
}
main()
{
string s='abcd';
cout<<f(s);
}
#include
#include
using namespace std;
string f(string s)
{
if(s.length()==1) return s;
else return f(s.substr(1))+s.substr(0,1);
}
main()
{
string s='abcd';
cout<<f(s);
}