Holes in the text..wrong answer..please help

Can someone please tell me what is wrong with this code. It always shows a wrong answer. Thanx in advance…Below is the code : -

#include <iostream>
#include <cstring>
using namespace std;
 
int main() {
	int t,cnt;
	string s;
	const char * c;
	while(t!=0)
	{
	scanf("%s",&s);
	c=s.c_str();
	cnt=0;
	while((*c)!='\0')
	 {
	 if((*c)=='A'||(*c)=='D'||(*c)=='O'||(*c)=='P'||(*c)=='Q'||(*c)=='R')
	   cnt++;
	 if((*c)=='B')
	   cnt+=2;
	 *c++;
	 };
	 printf("%d\n",cnt);
	t--;
	};
	return 0;
}

You are not taking the input for No of Test cases and you have to include header files for using printf and scanf also. The rest of the code is correct.

Here is your corrected code LINK

you have not taken any input for the number of test cases (variable t)
add this to your code
scanf("%d",&t);

thanx a lot…I had deleted this part of the code mistaking it to a comment…
But even after adding “scanf(”%d",&t)" i am getting a runtime error.

//