Recurrsion Duplicate Character Formatting

https://hack.codingblocks.com/practice/p/390/335

in my code it is showing no output.

#include
#include
using namespace std;
void convert(string a,string k,int i,int j,int n)
{

if(i==n-1)
{
   k[j]=a[i];
   k[j+1]='\0';
  cout<<k;
   }
if(a[i]==a[i+1])
{
    k[j]=a[i];
    j=j+1;
    k[j]='*';
 convert(a,k,i+1,j+1,n);
}
else
{
    k[j]=a[i];
convert(a,k,i+1,j+1,n);

}
}
int main() {
string a;
cin>>a;
string k="";
int n=a.length();

convert(a,k,0,0,n);

return 0;

}