Please tell problem in the code

#include
#include
#include
using namespace std;
bool check_cb_numbers(int a[],int num)
{
if(binary_search(a,a+10,num))
return true;
else{
for(int i=0;i<10;i++)
{
if(num%a[i]==0)
return false;
}
return true;
}
}
int find_cb_numbers(string s,int n )
{
int i=0,j,k,count=0,sum,factor;
int a[]={2,3,5,7,11,13,17,19,23,29};
for(i=0;i<n;i=j+1)
{
for(j=i;j<n;j++)
{
int num=s[j]-‘0’;
if(check_cb_numbers(a,num))
{
count++;
break;
}
else
{
sum=0;factor=1;
for(k=j;k>=i;k–)
{
sum=sum+(s[k]-‘0’)factor;
if(check_cb_numbers(a,sum))
{
count++;
break;
}
factor=factor
10;
}
}
if(k!=i)
break;
}
}
return count;
}
int main()
{
int n;
cin>>n;
string s;
cin>>s;
int x=find_cb_numbers(s,n);
cout<<x;
return 0;
}

Hello @namangarg31,

Please, share your code using Online Coding Blocks IDE.
The way you have shared it may introduce few syntax errors to it.

STEPS:

  1. Paste the code at https://ide.codingblocks.com/
  2. Save it there
  3. Share the URL generated.

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.