Finding the cb numbersa

#include
using namespace std;

bool iscb(int num)
{
int arr[10]={2,3,5,7,11,13,17,19,23,29};

if(num==0||num==1)
return false;

for(int i=0;i<10;i++)
{
	if(num%arr[i]==0)
	return false;
}

return true;

}

int main()
{
int n;
cin>>n;

string s;
cin>>s;

int count =0;
int i=0;

while(i<n)
{
int a=s[i]-‘0’;
if(iscb(a))
{
i++;
count++;
}

	else
	 {
	 	while(!iscb(a))
	 	{
	 		i++;
	 		int b=s[i]-'0';
	 		a=a*10+b;
	 		
		}
		i++;
		count++;
	 }

}

cout<<count;

return 0;

}

what is wrong in the code

Hi!
In this question, you also have to make sure that the digit should not be a part of any CB number before. So write a function for that as well

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.