What is the error in this

#include<bits/stdc++.h>
using namespace std;
void compute(int n,string s,int &ans){
if(n==0){
ans++;
return;
}
if(n<0)
return;
compute(n-1,β€œa”+s,ans);
int x=s.length();
if(s[x-1]!=β€˜b’)
compute(n-1,β€œb”+s,ans);
return;
}
int main(){
int t;
cin>>t;
int i=1;
while(t–){
int n;
cin>>n;
int count=0;
compute(n,"",count);
cout<<"#"<<i++<<" : "<<count<<endl;
}
return 0;
}

hey @manikanand4 your code isn’t readable here
You can share this code using ide.codingblocks.com

  • A special url will be generated, share that url with me

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.