#include<stdio.h>
#include<string.h>
int main()
{
int t,i,count=0;
char str[1000];
scanf("%d",&t);
while(t>0)
{
scanf("%s",str);
for(i=0;i<strlen(str);i++)
{
if(str[i]==‘A’ || str[i]==‘D’ || str[i]==‘O’ || str[i]==‘P’ || str[i]==‘Q’ || str[i]==‘R’)
{
count++;
}
if(str[i]==‘B’)
{
count+=2;
}
}
printf("%d",count);
count=0;
t–;
}
return 0;
}
Add a new line, that’s it
printf("%d\n",count);