The following code gave WA.
#include <iostream>
using namespace std;
int holesCalc(char c)
{
int hole;
if(c=='A' | c=='Q' | c=='D' | c=='O' | c=='P' | c=='R')
hole=1;
else if(c=='B')
hole=2;
else
hole=0;
return hole;
}
int main()
{
char a[100]; int holes;
int t;
cin>>t;
while(t>0){
holes=0;
cin>>a;
for(int i=0;a[i]!='\0';i++)// your code goes here
holes=holes + holesCalc(a[i]);
cout<<holes;
t--;
}
return 0;
}