Segmenttion error

help me to remove it

#include

#include

#include

#include

#include

#include

using namespace std;

void number(string s,int n,int i,int count)

{if(i==n)

{cout<<count;}

s[i]=s[i]-‘0’;

count=count*10+s[i];

number(s,n,i+1,count);

}

int main()

{string s=“1”;

cin>>s;

int n=1;

n=s.length();

int i=0;

int count=0;

number(s,n,i,count);

return 0;}

please share code through ide.codingblocks.com

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.